During initial development of the page the same datagrid was placed directly in the content section of a page and its behavior was normal; when this datagrid and other controls were put into a user control and the user control added to the page I began getting this error;
"Invalid postback or callback argument. Event validation is enabled using
I checked to make sure that the user control was registered in the page that was hosting it -- it was -- so I was a little puzzled at why the host page wasn't recognizing the user control.
Googling the problem turned up a lot of responses saying that changes could be made in the config file to turn off this security feature but this seemed a little kludgy.
Tracing the problem in the debugger I found that the failure was occuring during the Page_Load event in the page lifecycle of the user control and failing on the code in that event handler. I moved the code that was in the "Page_Load" event handler into the 'Page_Prerender" event handler and this problem stopped.
I am not quite sure why this worked, I'll write a comment to this blog entry if I figure it out.
1 comment:
Here's a webpage with a relevant clue in it by a contributor named 'Burda':
http://www.c-sharpcorner.com/Forums/Thread/35301/invalid-postback-or-callback-argument-event-validatio.aspx
Post a Comment