0

I want to increase executionTimeout of a controller Method. Options i tried so far :

  1. Web.config enter image description here

<location path="Components/FileUploadExplorer/Controllers/FileUpload/ChunkSave" <system.web> <httpRuntime executionTimeout="12000" maxRequestLength="100000" requestLengthDiskThreshold="1024"/ </system.web>

  1. Wanted to try this but not able to Find Current property in the controller. Using .Net 4.5

    HttpContext.Current.Server.ScriptTimeout = 300;

  2. Cant change Timeout in Application_BeginRequest as it will change for all the pages.

Any help is appreciated ?

Bokambo
  • 4,204
  • 27
  • 79
  • 130

1 Answers1

0

Does this work for you?

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

You can set this programmatically in the controller:-

System.Web.HttpContext.Current.Server.ScriptTimeout = 300;

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

Kyle Crabtree
  • 198
  • 1
  • 10
  • See my point No 2 above i tried this but Current property is not recognized. So i tried using HttpContext.Server.ScriptTimeout = 300; but looks like it does not work. I tried setting this as first line in the Actionmethod of the controller. – Bokambo Feb 19 '21 at 19:59
  • I will update my answer. Using System.Web.HttpContext.Current.Server.ScriptTimeout works for me. – Kyle Crabtree Feb 24 '21 at 16:13