Click here to Skip to main content
13,248,562 members (85,417 online)
Rate this:
Please Sign up or sign in to vote.
See more:
In my webform I am using Jquery and Javascript for popup window and clientside validation.

In the popup window I add the combobox item using javascript. It's all works well.
But When I save the form
The following error occurs

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.

If I remove the update panel, when I select newly additem in the combobox, the above error is occured

Why? help me....
Posted 9-Nov-12 0:51am
Updated 9-Nov-12 1:04am
mehdi.sabet 9-Nov-12 8:34am
do you have any code in your page load of this page?
Mathlab 9-Nov-12 13:42pm
post the code for the page and the popup script and we can llok at it
mickfarrow 9-Nov-12 14:46pm
I had this problem a few weeks back also, it turns out that this behaviour is correct, when the page is posted back to the server it is expected to have the same controls present as when it was served up to the client. In your example you have used JQuery to construct a combo box, therefore the event validation fails as it detects the new control.
The easiest way to overcome this is by using server side code to populate the combo box. If you cannot do this you can turn off event validation, or use a method such as ajax instead of posting the form back.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

in the @page tag set enableEventValidation="false" you get resolved
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Easy/direct solution can be adding enableEventValidation="false" in your Page directive or Web.config file.

Detailed explanation here: Invalid postback or callback argument solution. Event validation...[^]

Interesting to read one blog entry related to same: “Invalid postback or callback argument” in ASP.NET[^] - It exposes few other reasons on why one can get the same error. Nice read.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.171114.1 | Last Updated 10 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100