Mar*_*ell 31
我想你要找的是ScriptTimeout.您可以在页面中设置此内容,如下所示:
Page.Server.ScriptTimeout = 60;
Run Code Online (Sandbox Code Playgroud)
超时值以秒为单位.
另外,请注意以下事实:如果您在调试模式下运行,则会忽略此操作并将超时设置为最大值; 不过,我认为这对你来说不是一个问题,因为你增加了超时,而不是降低它.
Kri*_*nan 16
根据这个页面,我也可以验证,另一个实现此目的的好方法是将其添加到您的配置中configSection:
<location path="~/MyPage.aspx">
<system.web>
<httpRuntime executionTimeout="600"/>
</system.web>
</location>
Run Code Online (Sandbox Code Playgroud)
然后,您还可以添加其他属性maxRequestLength="204800"或其他部分,例如:
<location path="~/MyPage.aspx">
<system.web>
<httpRuntime executionTimeout="6000" maxRequestLength="204800" />
</system.web>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="209715200" />
</requestFiltering>
</security>
</system.webServer>
</location>
Run Code Online (Sandbox Code Playgroud)
希望这可以帮助.