The message is shown when a page with partial postback regions (update panels) is refreshed by F5 or browser's refresh button and then a new partial postback request is performed. In this case the information stored in the page has been changed and causes not to be possible to perform partial postback. For pages like these the page parameter EnableEventValidation must be set to false:
<%@ Page EnableEventValidation="false" ....
Another case is described here: http://support.microsoft.com/kb/323744
Thanks for this post
ReplyDeleteHelp to understand the cause of the problem.
What role plays EnableEventValidation ?
EnableEventValidation is a very good feature of asp.net. Without any your efforts asp.net checks (validates) the postbacks. This can prevent hackers attacks and request manipulation. The actual function if that feature is to register all components which cause postback and then check their authenticity during requests (postbacks). That is whay is not very good to turn that feture off. In such cases I recommend you to be sure the postbacks cannot harm your data.
ReplyDeleteYou can do manually registering of the controls for validation by
Page.ClientScript.RegisterForEventValidation(this.UniqueId)
Consider well if you really can leave the page without that check up. :)
Thanks again for explaining.
ReplyDeleteso if EnableEventValidation is false, and I do want to be on the safe side, you suggests using the
RegisterForEventValidation, but wouldn't it be the same effect and the error "the satate infor is invalid....." will pop again ?
With RegisterForEventValidation you can choose the control which you want to be safe for events. You can disable event validation as a whole but enable for some of the controls on your page.
ReplyDeletePlease don't post only anonymous comments. Write your name below the comment. It's good to know who I am speaking to.
Ok thanks , understood what you explained.
ReplyDeleteyou have a nice blog, and I have put it in my fast favorite links.
very informative.
So I'm Ronen From Israel
nice to meet.
nice to meet you too..., I am from Bulgaria
ReplyDelete