ASP.NET Update Panel stops jquery from working
.net, asp.net, jquery, updatepanel
Solution
You can add an Asynchronous trigger to your page to call a JavaScript/jQuery function after any async call.
Place this code in your Page_Load() of your aspx code behind:
//This script handles ajax postbacks, by registering the js to run at the end of *AJAX* requests
Page.ClientScript.RegisterStartupScript(typeof(Page), "ajaxTrigger", "Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);", true);
Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "EndRequest", "function EndRequestHandler(sender, args){AsyncDone();}", true);
This code snippet will specifically call the JavaScript/jQuery function AsyncDone();
Problem
I have binded jquery events set for mouseenter mouseleave, as well as jquery draggable. The divs are placed in an update panel and when a button is clicked information is sent to the database and the update panel is updated. However when the panel is updated the jquery events no longer work. Any idea as to why this would be the case?