How do I set the request timeout for one controller action in an asp.net mvc application

后端 未结 3 973
执笔经年
执笔经年 2020-11-30 20:47

I want to increase the request timeout for a specific controller action in my application. I know I can do it in the web.config for the entire application, but I\'d rather c

3条回答
  •  独厮守ぢ
    2020-11-30 21:16

    You can set this programmatically in the controller:-

    HttpContext.Current.Server.ScriptTimeout = 300;
    

    Sets the timeout to 5 minutes instead of the default 110 seconds (what an odd default?)

提交回复
热议问题