ASP.Net Error: Invalid postback or callback argument

Last Reply 27 days ago By pandeyism

Posted 27 days ago

i am facing error when i am deleting row from gridview session.

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.

here is my row delete event...

int index = Convert.ToInt32(e.RowIndex);
DataTable dt = (DataTable)ViewState["buyitems"];
dt.Rows[index].Delete();
ViewState["dt"] = dt;
GridView1.DataSource = dt;
GridView1.DataBind();

please guide.