EventValidation Error
This killed me for a while. I had an ASPX (Master) page that includes some headers and footers from legacy ASP pages (reusability, maintainability). Those ASP pages were so badly designed to embed multiple forms and each forms within that does HTTP POST. So messy that I even thought of rewriting those whole headers and footers but I can’t since that will leave us with 2 sets to maintain.
When I started using the headers and footers in the ContentPlaceholder in my Master Pages it kept complaining about this error,
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.
After looking around for help there was nothing that lead me to a solution. Accidentally I found out by myself that it was because of the embedded <form>s that it complained. After working around with those forms to make sure that only one <form> get rendered on the final ASPX the problem got resolved. Hope it does help some of you who might be looking for a solution to this error.
Written by askars on July 17th, 2007 with 1 comment.
Read more articles on Misc and howto and ASP.NET and .Net and Tips and Tricks.















