views:

226

answers:

1

Hi All Consider that I have a page with a Button. when it clicks I want to execute a jquery script after the postbacks complete(not befor). I WANT TO DO THAT WITHOUT MS AJAX DOM AND DO THAT JUST WITH ASP.NET AND JQUERY. RegisterStartupScript just works one time. How I can do that? Thanks

+1  A: 
<script type=”text/javascript”>

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

function panelLoaded(sender, args){

    // Your code here

}

</script>

You would be accessing the PageRequestManager object which allows you to execute code after a page or ajax update panel finishes loading. Refer to http://stackoverflow.com/questions/1765650/asp-net-updatepanel-javascript-callback

You could also try using the LiveQuery Plugin for jQuery, which monitors for ajax events and rebinds elements.

a432511
this code needs ScriptManager in Page.No way that we can do that without ScriptManager ?thanks
nima_dir
The only other thing you could do is try the LiveQuery plugin for jQuery, which monitors for ajax events and rebinds after they complete. I haven't had the greatest luck using it with ASP.NET though.
a432511