How to solve the problem that JS cannot be loaded due to asp.net updatepanel
This article focuses on "how to solve the problem that asp.net updatepanel causes JS not to be loaded". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how to solve the problem that asp.net updatepanel causes JS not to load".
The copy code is as follows:
Var prm = Sys.WebForms.PageRequestManager.getInstance ()
Prm.add_endRequest (function () {
/ / re-bind your jquery events here
$(document) .ready (function () {
/ / begin
Var span = $("input [id * = 'txtSpan']")
Span.focusout (function () {
Var greaterthenzero = (span.val () = = 0)
If (span.val () = = 0) {
("# spRule") .show ()
$("input [id * = 'btnSave']") .attr ("disabled", "disabled")
}
Else {
("# spRule") .hide ()
$("input [id * = 'btnSave']") .removeAttr ("disabled")
}
});
/ / end
});
}
);
At this point, I believe you have a deeper understanding of "how to solve the problem that asp.net updatepanel causes JS not to load". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!