AJAX and ASP.Net 2.0 Problem for EnableEventValidation

M

Mihir

Hi There,

I've problem while I submit a button where I used AJAX, I created
simple page which will search the customer name from database using
AJAX. Once I search customer ID i need to search order related to that
customers. So on my page I've Search Button(Image Button).. Now if I
click on search button without selecting the customer from the result
which I get from AJAX method then it will work fine but if I select a
customer ID from the list which is populated by AJAX Method then I
click on search button it throws this error.. I dont know why?

Could you please explain about this that will be highly appriciated?
I'm attaching my full error message for your reference.

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.

Thanks and look forward to hear from you.

Mihir
 
B

Bruce Barker

to prevent hacking, asp.net validates postback values when it can. if the
postback is from a select (dropdown), then the value must be on the list of
values rendered. your JavaScript is probably adding an option, then posting
back - triggering the validation code. you must turn the validation off in
your case using either method mentioned in the error.

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,805
Latest member
ClydeHeld1

Latest Threads

Top