Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#ASP.NET
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 8-Nov-12 23:51pm
devausha1.4K
Edited 9-Nov-12 0:04am
v2
Comments
mehdi.sabet at 9-Nov-12 8:34am
   
do you have any code in your page load of this page?
Mathlab at 9-Nov-12 13:42pm
   
post the code for the page and the popup script and we can llok at it
mickfarrow at 9-Nov-12 14:46pm
   
Hi, 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
good
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.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

in the @page tag set enableEventValidation="false" you get resolved
  Permalink  

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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 462
1 sanket saxena 355
2 OriginalGriff 235
3 Abhinav S 233
4 CPallini 205
0 Sergey Alexandrovich Kryukov 8,784
1 OriginalGriff 5,025
2 Peter Leow 3,839
3 Maciej Los 3,535
4 Er. Puneet Goel 3,107


Advertise | Privacy | Mobile
Web03 | 2.8.140415.2 | Last Updated 10 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid