Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Tuesday, February 26, 2019 1:52 PM
Hi.
I am using VS 2010.
I am using script manager and update panel in my aspx page. I am getting timeout error. I tried using the below code:
<script type="text/javascript">
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function (sender, args) {
if (args.get_error() && args.get_error().name === 'Sys.WebForms.PageRequestManagerTimeoutException') {
args.set_errorHandled(true);
}
});
</script>
How to fix this?
Thanks
All replies (2)
Wednesday, February 27, 2019 2:10 AM âś…Answered
Hi venkatzeus,
Where do you put your script?
If you put in front of the form mark up, it will show this error.
// please don't put here
<script type="text/javascript">
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function (sender, args) {
console.log("success");
//if (args.get_error() && args.get_error().name === 'Sys.WebForms.PageRequestManagerTimeoutException') {
// args.set_errorHandled(true);
//}
});
</script>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button runat="server" Text="Button" />
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
Please put after the form mark up or inside the form mark up.
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button runat="server" Text="Button" />
</ContentTemplate>
</asp:UpdatePanel>
</form>
<script type="text/javascript">
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function (sender, args) {
console.log("success");
//if (args.get_error() && args.get_error().name === 'Sys.WebForms.PageRequestManagerTimeoutException') {
// args.set_errorHandled(true);
//}
});
</script>
</body>
Best regards,
Ackerly Xu
Monday, March 4, 2019 2:08 PM
Thanks.
That worked