Another trick or work-around (i think) to make jQuery work right after UpdatePanel server request.
On my example code below, I have a textbox that has class name "datefield" that shows jQuery date picker (date calendar) when you click the textbox.
Javascript:
function load() {
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
}
function EndRequestHandler() {
AsyncDone();
}
function AsyncDone() {
$(".datefield").datepicker();
}
jQuery(document).ready(function ($) {
AsyncDone();
});
C# codebehind
ScriptManager.RegisterStartupScript(UpdateThis, typeof(UpdatePanel), "EndRequest", "load();", true);
L.
jQuery doesn't work after post update in UpdatePanel
Lerrie | Wednesday, April 1, 2015 | Labels: ASP.NET, C#, jQuery, UpdatePanel, Visual Studio
Subscribe to:
Post Comments (Atom)





0 comments:
Post a Comment