ICallbackEventHandler and "Invalid postback or callback argument" error

  • Thread starter Thread starter matsla
  • Start date Start date
M

matsla

Hi,

I use the ICallbackEventHandler interface, as per "Implementing
Client Callbacks Without Postbacks in ASP.NET Web Pages".

When i update some dropdown controlls in the callback and then do a
postback i get following error =>

"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. "


I could change the page enableEventValidation="false", but then the
page validation doesn't work.

Any ideas how to solve this

Thanks in advance

// Mats
 
You have to register the script block thru the
RegisterForEventValidation method and before registering check for
IsCallback.

Then, you dont need to set enableEventValidation="false", it can be true.

-
Vadivel Kumar
http://vadivelk.net
 
Vadivel said:
You have to register the script block thru the
RegisterForEventValidation method and before registering check for
IsCallback.

Then, you dont need to set enableEventValidation="false", it can be true.

-
Vadivel Kumar
http://vadivelk.net


Thanks for the advice.

I've tried to use the RegisterForEventValidation for every control in
the form but still get same problem. How do i use this function?

If i use enableEventValidation="false" the post back doesn't contain
the selected value in the dropdown box that i load with the callbak...

Thanks

// Mats
 
Back
Top