February 6, 2016

invalid postback or callback argument. Event validation is enabled using 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.

Reason: There are multiple scenario in which this error come.


if we try to change the property of asp.net control through the Javascript after page load then above issue comes.

This error might be coming from one of the user control present on the page
(Search or header)

Or

forgot to add an ID to a dynamically created control.

Or
check design contain two nested <form></form> tag

Or
other......

Solution:

Remove two nested <form></form> tag

OR
<pages validateRequest="false" enableEventValidation="false" />
and do Toolscriptmanager partial rendering is enabled

OR
IsPostBack in page load

OR
Use update panel which attribute is changing due to javascript

OR
ScriptManager scriptManager = ScriptManager.GetCurrent(this.Page);
scriptManager.RegisterPostBackControl(buton1);

OR
Other...........

No comments: