ASP.Net Error: Invalid postback or callback argument

Last Reply 6 months ago By pandeyism

Posted 6 months 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.

You are viewing reply posted by: pandeyism 6 months ago.