I'm looking for something like OnClientClick for a button, but I want it to happen after the postback (instead of before). I'm currently using the following, which works, but it adds the script block over and over again, which is not what I want. I simply want to execute an existing client script function.
ScriptManager.RegisterClientScriptBlock(
this,
typeof( MyList ),
"blah",
"DraggifyLists();",
true );
From stackoverflow
-
One of these might help:
ClientScriptManager.GetCallbackEventReference
Functions to execeute before and after an Asynchronous postback via ASP.net AJAX
-
If you're using ASP.NET AJAX, you could try the following:
addRequestHandler()
must be called when your page loadsfunction addRequestHandler() { Sys.WebForms.PageRequestManager.getInstance().add_endRequest(endRequestHandler); } function endRequestHandler(sender, args) { // This function will be called after the postback has completed // add your JavaScript function call here }
This is based on code from Disturbed Budda
0 comments:
Post a Comment