Hi there,
You can get this error for a number of reasons. The most common one is in a situation where the client page (HTML) submits to the server through controls that don't exist (anymore) in the page.
So, let's say your browser shows a button called btnSubmit. On the server, you rename the button in the ASPX page to SubmitButton and then click btnSubmit (or press Ctrl+F5)in the browser to reload the page. Then the browser submit to the server with btnSubmit as the postback control. However, at the server this control no longer exists and you get the error you posted.
You may also run into this when programmatically adding and removing controls from a page through code.
This feature was added to prevent abuse. For example, consider this:
DeleteButton.Visible = User.IsInRole("Administrators");
When the user is not an admin, she doesn't see the DeleteButton. However, you could hack your way around this by adding an HTML button to a fake HTML page and submit. The event validation stops hackers from abusing this mechanism as it requires controls that submit to the server to be in the initial request before the post back.
Hope this helps,
Imar
|