增加.ashx的超时

You*_*eee 7 c# ashx

简单的问题:我需要增加一个ashx的超时.

Mar*_*eby 12

你可以增加服务器超时:

public void ProcessRequest(HttpContext context)
    {
        context.Server.ScriptTimeout = 3600;
        context.Response.ContentType = "text/plain";
        context.Response.Write("Hello World");
    }
Run Code Online (Sandbox Code Playgroud)

  • 这真的有用吗?它是否会覆盖所有页面的脚本超时以及web.config中的设置? (4认同)