How to increase maxUrlLength property in config in asp.net MVC 3?

I get this error:

The URL for this request is longer than the configured maxUrlLength value.

Looking back at the closest thing I can find is in the web.config file,

<requestFiltering> <requestLimits maxUrl="xxx"> </requestFiltering> 

However, this is not MaxUrlLength and does not fix the problem. Any ideas how to fix it?

+42
asp.net-mvc
Nov 23 '11 at 16:39
source share
5 answers

According to Ashok's answer, which will be equal to:

 <httpRuntime maxUrlLength="1024" relaxedUrlToFileSystemMapping="true"/> 

in the <system.web> section of the web.config file.

+68
Nov 23 '11 at 18:25
source share
— -

Take a look at this post from Hanselman . Although this message is about accepting generally invalid characters in the URL, he also mentions how to set the path length and query string

While we are here, note that in ASP.NET 4 you can also change the valid path and length of the query string:

 <httpRuntime maxRequestPathLength="260" maxQueryStringLength="2048" /> 
+8
Nov 23 '11 at 19:36
source share

I had this problem in a recreation service that I created using C # .net 4. I set the variable maxUrlLength in the system.web section of the Web.Config file.

 <?xml version="1.0"?> <configuration> <system.web> <compilation debug="true" targetFramework="4.0" /> <httpRuntime maxUrlLength="2000"/> </system.web> .... 
+6
02 Aug. '13 at 20:49 on
source share

You saw this msdn article, it looks like what you need

+4
Nov 23 '11 at 17:15
source share

Having the same problem in IIS8, the solution was to change the root Web.config for the .NET Framework. This file is located in the% windir% \ Microsoft.NET \ Framework \ framework_version \ CONFIG folder. Editing the web.config file in the root of the site did not solve the problem.

0
May 01 '14 at 21:49
source share



All Articles