Tuesday, May 24, 2011

Invalid postback or callback argument.  Event validation is enabled using in configuration....

I had a datagridview in which I added an EDIT button so that I click on edit button to edit that records. Whenever I clicked that button I would get this error.
Invalid postback or callback argument.  Event validation is enabled using in configuration

After googling alot I got some crazy answers like go to web.config and set enableEventValidation to true but this didn't solved problem. At the end it was simple. Just put your databinding code (in my case LoadData() function) inside IsPostBack like this.

if (!IsPostBack)
{
LoadData();
}

Happy coding...:)

No comments:

Post a Comment