I would like to understand how I can run client-side javascript after an update panel has finished updating given various constraints. My development scenario is non-trivial however, I would like to illustrate the problem by describing a simpler case.
I have a user-control containing an update panel which contains a button and a table. When the user clicks the button an async postback occurs, the table's rows will be changed and the altered table will be returned and rendered on the client.
I would like to run a a script to perform some custom formatting on the table. Lets say for now I want to zebra stripe the table. (Actual requirements are more complex).
I thought I would simply be able to emit script as part of the user controls output and whenever an update occurs the table markup and the script would be handled on the client and all would be fine, but that technique does not work.
I've seen other posts that reference ClientScriptManager, but that doesn't seem to be available inside my user control. Should I add a ScriptManagerProxy?
So what's the best way to proceed, given the constraints.
Looks like I need to
I seem to have seen many examples which are close but none which match my circumstances; I can't quite figure out how to get it all to hang together.
you will have to write EndRequestHandler for it. It is a very common problem,Javascript,Jquery stops working after async postback from update panel. In this link i have explained how to do it. http://codethatworkedforme.blogspot.com/2011/08/having-issues-with-update-panel.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With