I came across this issue recently and thought it was really helpful. My question was, how would you call a piece of javascript after an updatepanel loads via AJAX in ASP.NET?
I needed to reinitialize a jQuery datepicker after the panel had loaded.
<script type=”text/javascript”>
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_pageLoaded(panelLoaded);
function panelLoaded(sender, args){
// Your code here
}
</script>
Essentially this is creating an instance of the PageRequestManager which handles all the UpdatePanel loading. Then ties the panelLoaded function to the pageLoaded event.
I also found this article which explains this is much more detail: http://msdn.microsoft.com/en-us/magazine/cc163413.aspx
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