Click here to Skip to main content
16,018,802 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,

Error comin on click of edit in the datagridview.

The error is"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."


Please help me to resolve it asap.

Regards,
vengaqua
Posted
Comments
thatraja 17-Oct-13 3:08am    
Include code in your question to get quick response
mvengaqua 17-Oct-13 3:15am    
This error is comin when i am clicking on the edit button in the gridview.I have not written anything on gridview editing.

1 solution

Set the EnableEventValidation to False in the aspx page to get through this error.
 
Share this answer
 
Comments
Tom Marvolo Riddle 17-Oct-13 3:00am    
@Shridhar panigrahi:EnableEventValidation = False will leads to form spoofing.Don't recommend this
mvengaqua 17-Oct-13 3:08am    
After doin this the nothing happens on when i click on edit in the grid. how to edit the items in the gridview now.
Thanks7872 17-Oct-13 3:43am    
http://www.aspdotnet-suresh.com/2011/02/how-to-inserteditupdate-and-delete-data.html

See this and do it your self.Simple.
mvengaqua 17-Oct-13 4:19am    
hey rohan....thanks but it is of no help....i have done this....i cannot find where that property is enabled.
ShridharPanigrahi 17-Oct-13 6:59am    
@Jas24 : You are correct, it involves a security risk

@mvangaqua : Even when you changed "EnableEventValidation=False" nothing happens on click of edit, because it u need to handle the OnRowEdit event and set the row in question to edit mode. Below code might help:

protected void gridView1_OnRowEditing(object sender, GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex;

}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900