我在 ajax 中有很长的过程导致问题
我在脚本管理器中添加了 asyncpostbacktimeout=600
<asp:ScriptManager AsyncPostBackTimeOut="600" runat="server" ID="SmPage" EnablePageMethods="true" />
在本地主机上运行良好, 但是当我在服务器上测试它时它仍然有一些问题
有什么建议吗? 谢谢
最佳答案
您可能必须在 web.config 中增加 executionTimeout
,否则请求本身会超时。
看看executionTimeout在 msdn。它解释了 Debug=True/False 之间的区别,这可能导致本地主机和生产之间的差异。
executionTimeout Optional Int32 attribute.
Specifies the maximum number of seconds that a request is allowed to execute before being automatically shut down by ASP.NET.
This time-out applies only if the debug attribute in the compilation element is False. If the debug attribute is True, to help avoiding application shut-down while you are debugging, do not set this time-out to a large value.
The default is 110 seconds.
将 executionTimeout
添加到 Web.Config
中的 configuration/system.web/httpRuntime
并让我知道它是否有效:
<configuration>
<system.web>
<httpRuntime executionTimeout="600" />
</system.web>
</configuration>
关于c# - ajax超时问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7282811/