M
Martin
Hi,
I have an aspx page with two dropdownlist controls.
I update the options in the second ddl based on selection made in the first.
I do this with the ICallbackEventHandler interface, as per "Implementing
Client Callbacks Without Postbacks in ASP.NET Web Pages"
(http://msdn2.microsoft.com/en-us/library/ms178208.aspx)
This works.
However I now want to process the selection subsequently made in the second
ddl, when a button web server control is pressed, caused a normal postback.
When I click the button, I get the 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 believe it is refering to the SelectedIndexChanged event on the second
ddl, which itself does not cause a postback, but should be processed on an
eventual postback (in this case the button.click).
In a nutshell, I'm not clear where to place my call to
RegisterForEventValidation, nor whether/where I should call ValidateEvent.
The example at How to: Implement Callbacks in ASP.NET Web Pages at
http://msdn2.microsoft.com/en-us/library/ms366518(d=ide).aspx doesn't match
my scenario.
Any help much appreciated.
Thanks
Martin
I have an aspx page with two dropdownlist controls.
I update the options in the second ddl based on selection made in the first.
I do this with the ICallbackEventHandler interface, as per "Implementing
Client Callbacks Without Postbacks in ASP.NET Web Pages"
(http://msdn2.microsoft.com/en-us/library/ms178208.aspx)
This works.
However I now want to process the selection subsequently made in the second
ddl, when a button web server control is pressed, caused a normal postback.
When I click the button, I get the 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 believe it is refering to the SelectedIndexChanged event on the second
ddl, which itself does not cause a postback, but should be processed on an
eventual postback (in this case the button.click).
In a nutshell, I'm not clear where to place my call to
RegisterForEventValidation, nor whether/where I should call ValidateEvent.
The example at How to: Implement Callbacks in ASP.NET Web Pages at
http://msdn2.microsoft.com/en-us/library/ms366518(d=ide).aspx doesn't match
my scenario.
Any help much appreciated.
Thanks
Martin