We have a web data grid (v11.1). Inside the OnRowUpdating event we, sometimes, need to set some javascript code to be run once the call returns to the client.
Are there any examples on how to do this?
We've tried a few variations of this inside the OnRowUpdating handler with no luck:
String scriptString = "<script language=JavaScript>alert('dummy string');</script>";
Page.ClientScript.RegisterClientScriptBlock(GetType(), "xxxxxx", scriptString);
Thank you
Hello and_e,
Please do not hesitate to contact me if you have any further questions regarding this matter.
In order to register a script to be executed immediately after the response from the code behind you may want to use the RegisterStartupScript method:
Page.ClientScript.RegisterStartupScript(Page.GetType(), "test1", "alert('test1234');console.log('abc1');", true);
Note that in order for this to work, the grids AJAX also needs to be turned off.
As an alternative, you may be interested in using the clientside RowUpdated event of the editing core. This event will be fired after changes have been made on the server and the response has been sent back to the client.
Hope this helps. Please feel free to contact me with any questions.