Click here to Skip to main content
16,007,779 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi , my dear friends ..


i want help in my website developing programming ...i have 1 data list control .in that having image button ..when i am click on the image button that it will navigate to another page using command argument and onitemcommand of datalist but whaen i am click on button it will shows error is

C#
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 help me how to solve the above problem ..please ..i hope you understand my problem please friends....i want immediately...
Posted
Comments
BHABANI PRASAD DASH 6-Jan-16 7:52am    
The problem is that ASP.NET does not get to know about this extra or removed listitem. You got an number of options (listed below):

Disable eventvalidation (bad idea, because you lose a little of security that come with very little cost).
Use ASP.NET Ajax UpdatePanel. (Put the listbox in the Updatepanel and trigger a update, if you add or remove listbox. This way viewstate and related fields get updates and eventvalidation will pass.)
Forget client-side and use the classic postback and add or remove the listitems server-side.
I hope this helps.

1 solution

C#
The problem is that ASP.NET does not get to know about this extra or removed listitem. You got an number of options (listed below):

Disable eventvalidation (bad idea, because you lose a little of security that come with very little cost).
Use ASP.NET Ajax UpdatePanel. (Put the listbox in the Updatepanel and trigger a update, if you add or remove listbox. This way viewstate and related fields get updates and eventvalidation will pass.)
Forget client-side and use the classic postback and add or remove the listitems server-side.
I hope this helps.


or
ASP.NET
<%@ Page EnableEventValidation="false" %>
 
Share this answer
 
v2

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