Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

HttpRuntimeSection.MaxUrlLength Property

.NET Framework 4.6 and 4.5

Gets or sets the maximum possible length, in number of characters, of the URL in an HTTP request.

Namespace:  System.Web.Configuration
Assembly:  System.Web (in System.Web.dll)

[ConfigurationPropertyAttribute("maxUrlLength", DefaultValue = )]
[IntegerValidatorAttribute(MinValue = )]
public int MaxUrlLength { get; set; }

Property Value

Type: System.Int32
The length of the URL, in number of characters. The default is 260.

The value of the MaxUrlLength property can be any integer, zero or larger.

NoteNote

Extremely small values can make a Web site unusable.

If the length of the request URL (which is the value of the Path property) exceeds the configured size limit, ASP.NET returns an HTTP 400 (Bad Request) status code

You can set this value in a configuration file by setting the MaxUrlLength attribute of the httpRuntime element. For more information, see httpRuntime Element (ASP.NET Settings Schema).

.NET Framework

Supported in: 4.6, 4.5, 4
Show:
© 2015 Microsoft