ICallbackEventHandler and "Invalid postback or callback argument" error

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
 
V

Vadivel Kumar

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
 
M

matsla

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
 

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,770
Messages
2,569,584
Members
45,076
Latest member
OrderKetoBeez

Latest Threads

Top