0

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.

Please explain me what is this error mean.
I didn't understand what to do.
please do the needful.
Thanks in advance.

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by srky
0

Short version, you have a form text field that is trying to pass script directly via your code-behind.

Example:
TextBox contains <a href="http://yourURL.com/">
TextBox contains <script="scriptHere">

Some server configurations prevent passing scripts from forms via code-behind as a security precaution.

Option 1: Disable this security precaution ("<%@ Page EnableEventValidation="true" %> in a page") Not a good option as it opens up many security holes in your application/site
Option 2: Provide alternate text modification methods (such as [ B][ /B]) that are handled at the code-behind level to convert the text to html equivalents so that html code is not being passed from the textbox/source and disable (possibly via RegEx) script from being entered into your textbox/source. Difficult (but not impossible) to code
Option 3: "use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation" simpler to code but still opens possible security issues in your code/site if not handled correctly

Hope this helps :) Please remember to mark solved once your issue is resolved.

Edited by Lusiphur: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.