Bokambo
Bokambo

Reputation: 4480

Increase executionTimeout of MVC Controller Method

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 ?

Upvotes: 0

Views: 2650

Answers (1)

Kyle Crabtree
Kyle Crabtree

Reputation: 208

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?)

Upvotes: 0

Related Questions