Do you know more about Sys.WebForms.PageRequestManager Class? It manages partial-page updates of server UpdatePanel controls in the browser, and defines properties, events, and methods that can be used to customize a Web page by using client script.
The endRequest event is raised after an asynchronous postback is finished and control has been returned to the browser. You could use this event to provide a notification to users or to log errors.
If you need to show the datapicker,you could use the pageLoaded event.
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
290 Points
669 Posts
APPLY THIS CODE
Jan 07, 2021 12:31 PM|Gopi.MCA|LINK
HELLO
HOW TO APPLY THIS CODE
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
function EndRequestHandler(sender, args) {
FOR THIS CODE
<script>
$(function () {
$(".dd").datepicker({
dateFormat: "dd-M-yy",
minDate: new Date('2017/11/01'),
changeYear: true,
changeMonth:true,
yearRange: '2017:2022',
});
});
</script>
tHANKINF YOU
Member
180 Points
168 Posts
Re: APPLY THIS CODE
Jan 07, 2021 10:04 PM|SurferOnWww|LINK
Can you describe the poupose of the code (i.e, what dou want to do with the code) in detail?
Contributor
3430 Points
1310 Posts
Re: APPLY THIS CODE
Jan 08, 2021 02:56 AM|yij sun|LINK
Hi Gopi.MCA,
Do you know more about Sys.WebForms.PageRequestManager Class? It manages partial-page updates of server UpdatePanel controls in the browser, and defines properties, events, and methods that can be used to customize a Web page by using client script.
The endRequest event is raised after an asynchronous postback is finished and control has been returned to the browser. You could use this event to provide a notification to users or to log errors.
If you need to show the datapicker,you could use the pageLoaded event.
Just like this:
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.10.0.min.js" type="text/javascript"></script> <script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.9.2/jquery-ui.min.js" type="text/javascript"></script> <link href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.9.2/themes/blitzer/jquery-ui.css" rel="Stylesheet" type="text/css" /> <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/js/bootstrap-datepicker.js" type="text/javascript"></script> <script> $(function () { Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(picker); function picker() { $("#dd").datepicker({ dateFormat: "dd-M-yy", minDate: new Date('2017/11/01'), changeYear: true, changeMonth: true, yearRange: '2017:2022', }); } }) </script> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"> <ContentTemplate> <div class="form-group row"> <div class="col-sm-12"> <asp:TextBox ID="dd" class="form-control" runat="server"></asp:TextBox> </div> </div> </ContentTemplate> </asp:UpdatePanel>
More details,you could refer to below article:
https://docs.microsoft.com/en-us/previous-versions/bb311028(v=vs.100)?redirectedfrom=MSDN
Best regards,
Yijing Sun