[Developers_For_Ever] Invalid postback or callback argument when Implement ICallbackEventHandler

Monday, December 12, 2011

 

Hi:

Please help me to fix this issue,

I have a page that implement the ICallbackEventHandler, and it has a user control that register a script that callback the server

#region Add the categories_onchange function

string callbackScript = this.Page.ClientScript.GetCallbackEventReference(
this.Page,
"'[' + categoryID + ']'",
"showProducts",
"null");

this.Page.ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "categories_onchange", @"
function categories_onchange(sender)
{
lastChangedSelect = sender;

initSelects(false, '" + btnSave.ClientID + @"');
clearResults();

var categoryID = sender.value;
if (categoryID > 0)
{
" + callbackScript + @"
}
}", true);

0 comments:

Post a Comment