HttpRuntimeSection::MaxQueryStringLength Property
Gets or sets the maximum possible length, in number of characters, of a query string in an HTTP request.
Assembly: System.Web (in System.Web.dll)
[IntegerValidatorAttribute(MinValue = )] [ConfigurationPropertyAttribute(L"maxQueryStringLength", DefaultValue = )] public: property int MaxQueryStringLength { int get (); void set (int value); }
Property Value
Type: System::Int32The maximum length of the query string, in number of characters. The default is 2048.
The value of the MaxQueryStringLength property can be any integer, zero or larger. If the length of a query string exceeds the size limit, ASP.NET returns an HTTP 400 (Bad Request) status code.
Note |
|---|
Extremely small values can make a Web site unusable. |
You can set this value in a configuration file by setting the maxQueryStringLength attribute of the httpRuntime element. For more information, see httpRuntime Element (ASP.NET Settings Schema).
Note |
|---|
There is also an IIS setting that controls query string length. See the maxQueryString attribute in Request Limits <requestLimits>. |
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Note