ASP.NET UpdatePanel Javascript Callback

I recently ran into this problem and thought it was really useful. My question was, what would you name the javascript part after loading the updatable platform through AJAX in ASP.NET?

I needed to reinitialize the jQuery datepicker after loading the panel.

+5
source share
2 answers
<script type="text/javascript">

var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_pageLoaded(panelLoaded);

function panelLoaded(sender, args){

    // Your code here

}

</script>

Essentially this creates an instance of PageRequestManager that handles the entire load of the UpdatePanel. Then binds the panelLoaded function to the pageLoaded event.

I also found this article that explains it in much more detail: http://msdn.microsoft.com/en-us/magazine/cc163413.aspx

+10

. :

  • <meta http-equiv="X-UA-Compatible" content="IE=10"/>

  • javascript, javascript, <ScriptReference Path="myfile.js"> <ajaxToolkit:ToolkitScriptManager><Scripts>.

. VS Studio Express 2013 Web Windows 7 Enterprise Windows 2003.

0

All Articles