Bootstrap date picker inside Update Panel in ASP.n

2020-05-09 18:15发布

问题:

I am using bootstrap datepicker which is working inside update panel if i write

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
 function EndRequestHandler(sender, args) 
 {
 $('.form-control.reqByDate').datepicker({ format: "dd-M-yyyy", changeMonth: true, changeYear: true, autoclose: true });
 };

But I am also using :

 Response.write("<script>alert('something to alert ')</script>") ; (ignore syntax as it works fine without the endrequesthandler)

which stops working... is there any relation can someone help me to get both the things working

the datepicker code is in document.ready function with:

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);