Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I increase the maxUrlLength property in the config in asp.net MVC 3?

Tags:

asp.net-mvc

I am getting this error:

The length of the URL for this request exceeds the configured maxUrlLength value.

Looking around the closest thing I can find is in the web.config,

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

However this is not MaxUrlLength nor does it resolve the issue. Any ideas how to fix?

like image 955
NibblyPig Avatar asked Nov 23 '11 16:11

NibblyPig


People also ask

Is MaxUrlLength max value?

Remarks. The value of the MaxUrlLength property can be any integer, zero or greater. Extremely small values can make a Web site unusable. You can set this value in a configuration file by setting the MaxUrlLength attribute of the httpRuntime element.

What is MaxRequestLength?

The MaxRequestLength property specifies the limit for the buffering threshold of the input stream. For example, this limit can be used to prevent denial of service attacks that are caused by users who post large files to the server.

What is configuration in MVC?

ASP.NET MVC configuration In ASP.NET apps, configuration uses the built-in . NET configuration files, web. config in the app folder and machine. config on the server. Most ASP.NET MVC and Web API apps store their settings in the configuration file's appSettings or connectionStrings elements.


1 Answers

As per Ashok's answer that would equate to:

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

within <system.web> section of the web.config.

like image 103
Jesse Avatar answered Oct 12 '22 13:10

Jesse