I am getting the following error on a button click with gridview
Server Error in \'/\' Application.
Invalid postback or callback argument. Event validation
1) Invalid Postback or Callback argument in GridView Problem may be: You are binding data in Page_Load event with either Object Data Source or Manual Binding with function call. This will make your GridView bind data on every event fire of any control.
When you are firing any GridView command with OnRowCommand, before RowCommand fire your GridView will rebind and all control within it will be assigned to new id. So RowCommand could not get the item which have fired the event.
Solution for Invalid Postback or Callback argument in GridView: You can bind your data within this if condition
if (!IsPostBack)
{
//Your code for Bind data
}
This code will definitely give you solution if this not work then check whether any other control is not giving error.
A few things to try
Page Load
event, add a check for !Page.IsPostBack
and move the non-authenticating code block there.LinkButton
instead of a regular button.I testing all above solutions and other posts but my problem isn't done.
My problem was solved when cancel event at end of grid event at server side.
This type of problem occurred when we using edit event of gridview. just add e.Cancel = true; at the end of event.
protected void grdEducation_RowEditing(object sender, GridViewEditEventArgs e)
{
// do your processing ...
// at end
e.Cancel = true;
}
This could be because of any third party controls you are using.
I also had this error. In my case i have a repeater control inside updatepanel and inside repeater control i was using telerik datepicker control. It was working fine in IE but not in mozilla and chrome. I examined the form data in both the cases by sending request from chrome and IE and found that the triggring control values are slightly different. i used telerik RadAjaxmanager instead of updatepanel the error gone.
are you updating the Grid or any such control through javascript or Ajax.
If this is the case then you might face this. Possible solution can be to set EnableEventValidation to false.