问题陈述 触发事件时,updateprogress 会无限期运行,更新面板不会刷新,或者请求不会在 IIS 8.5 (Windows Server 2012) 中结束。
以下代码供参考
母版页
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="XXXMaster.Master.cs" Inherits="XXXWeb.Common.MasterPage.CoReMQWebSite" %>
<asp:ScriptManager ID="ScriptManagerMain" runat="server" EnablePartialRendering="true" >
</asp:ScriptManager>
<asp:UpdateProgress ID="Updprg" runat="server">
<ProgressTemplate>
<div id="divProgress">
<table width="100%">
<tr>
<td>
<br />
</td>
</tr>
<tr>
<td align="center">
<asp:Label ID="lblProcessing" runat="server" CssClass="FieldLabel" Text="Processing... " />
</td>
</tr>
</table>
</div>
</ProgressTemplate>
</asp:UpdateProgress>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
<script type="text/javascript">
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler);
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
function BeginRequestHandler(sender, args) {
}
function EndRequestHandler(sender, args) {
//debugger;
//if UpdatePanel error occurs...
if (args.get_error() != undefined) {
var Error = "Error Occurred: [Code]:" +
args.get_response().get_statusCode() + " [Message]: ";
alert(Error);
//Hide default ajax error popup
args.set_errorHandled(true);
//...redirect error to your Error Panel on page
//document.getElementById("Label1").innerText = Error;
}
}
</script>
aspx page
---------
<%@ Page Language="C#" MasterPageFile="~/XXXMaster.Master" AutoEventWireup="true" ClientIDMode="AutoID" EnableEventValidation="false" CodeBehind="CommonAdminScreen.aspx.cs" Inherits="CoReMQWeb.CommonAdminScreen" Title="Common Admin Screen" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:UpdatePanel ID="upCommonAdmin" runat="server">
<ContentTemplate>
<asp:Button runat="server" ID="btnSaveCommonAdmin" CssClass="btn" onmouseout="this.className='btn'" onmouseover="this.className='btn btnhov'" Text="Save" CausesValidation="false" Width="75px" onclick="btnSaveCommonAdmin_Click" Visible="false"/>
<!-- then there is a grid to be updated on button click -->
已经尝试过的事情
- 在 web.config 中添加处理程序
网页配置
<!--<add assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>-->
</assemblies>
</compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
<authentication mode="Windows"/>
-->
<!--<authentication mode="Windows" />-->
<authentication mode="Forms">
<forms loginUrl="logon.ashx" name="AuthCookie" timeout="60" path="/"></forms>
</authentication>
<authorization>
<deny users="?" />
<allow users="*" />
</authorization>
<trust level="Full" originUrl="" />
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
<customErrors mode="Off" defaultRedirect="ErrorPageInternal.aspx" />
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
<controls>
<!--<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>-->
<!--<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>-->
<add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
</controls>
</pages>
<httpHandlers>
<remove verb="*" path="*.asmx" />
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false" />
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</httpModules>
.Net 框架是 4.5.2
在危机中,在周五之前使之可行。任何帮助/线索将不胜感激。
提前致谢。