Click here to Skip to main content
15,889,281 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I am using AJAX datepicker in my webform but when i am submitting that page i get the above error.
there are some fields in my webpage like name, date of birth, address, email, ph no etc.
When someone fill all the fields and press the submit button records are updated on the database.

Anyone can help me to find and solve these error.

---------------------
XML
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: 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.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.




Thanks in advance.
Posted
Updated 14-Oct-11 22:46pm
v2
Comments
DaveAuld 15-Oct-11 4:47am    
You should have updated the question with the additional information rather than added a comment containing it..........i have moved it for you.
sahabiswarup 15-Oct-11 4:51am    
thanks ...but can you please guide me to solve the above error
Ed Nutting 15-Oct-11 7:08am    
Your datepicker is created as a client side control - presumably you have put an input tag into your html. This is your problem. ASP.Net will not recognise it as a control that needs validating however, when you post back it will see the control there and so throw the above error as it does not know about it. To solve your problem you should wither create the control dynamically server-side or you should using <asp:TextBox> tags instead of input tags. Hope this helps, Ed :)
Nueman 15-Oct-11 8:52am    
Edward, Good answer. You should put it in a solution block so: 1) People know the question has been answered; 2) You get credit for it.

XML
Edward Nutting - 15 Oct '11
Your datepicker is created as a client side control - presumably you have put an input tag into your html. This is your problem. ASP.Net will not recognise it as a control that needs validating however, when you post back it will see the control there and so throw the above error as it does not know about it. To solve your problem you should wither create the control dynamically server-side or you should using <asp:TextBox> tags instead of input tags. Hope this helps, Ed :)
 
Share this answer
 
Hi,

in your page element add one attribute
C#
enableEventValidation="true"


hope this will work

thanks
-amit
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900