This is a migrated thread and some comments may be shown as answers.

[Solved] Button doesn't get to RadGrid1_ItemCommand

2 Answers 132 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Darren
Top achievements
Rank 2
Darren asked on 11 Jun 2009, 01:32 PM
Hi There,

Here is my error:
Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation

I have a button within my RadGrid. The button is supposed to fire the event RadGrid1_ItemCommand but it doesn't even get there. Instead I get that error. I have a RadScriptManager on my masterpage so I can add another one. I've tried EnableEventValidation="true" I've tried to even add it to the web.config but I keep receiving this error.

Any help would be appreciated thanks.

edit: Incase it matters. The Button carries the RecordId as an Argument which I want to use in code. If it got there.

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 12 Jun 2009, 09:25 AM
Hello Darren,

Try setting the EnableEventValidation attribute in the page directive to false rather than setting it to true and see if it helps. You can also refer to the following forum link which discusses on a similar issue:
error when using ButtonType="ImageButton"

Regards
Princy.
0
Accepted
peter
Top achievements
Rank 1
answered on 12 Jun 2009, 10:53 AM
if (!IsPostBack) 
//Bind the data to Gridview 

This was what I was missing. Was posting back and reloading the control before completing the previous request.
Tags
Grid
Asked by
Darren
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
peter
Top achievements
Rank 1
Share this question
or