HttpRuntimeSection.MaxQueryStringLength プロパティ

定義

HTTP 要求内のクエリ文字列の最大文字数を取得または設定します。

public:
 property int MaxQueryStringLength { int get(); void set(int value); };
[System.Configuration.ConfigurationProperty("maxQueryStringLength", DefaultValue=2048)]
[System.Configuration.IntegerValidator(MinValue=0)]
public int MaxQueryStringLength { get; set; }
[<System.Configuration.ConfigurationProperty("maxQueryStringLength", DefaultValue=2048)>]
[<System.Configuration.IntegerValidator(MinValue=0)>]
member this.MaxQueryStringLength : int with get, set
Public Property MaxQueryStringLength As Integer

プロパティ値

クエリ文字列の最大長 (文字数)。 既定値は 2048 です。

属性

注釈

MaxQueryStringLength プロパティの値には、0 以上の任意の整数を指定できます。 クエリ文字列の長さがサイズ制限を超えた場合、ASP.NET は HTTP 400 (無効な要求) 状態コードを返します。

値が非常に小さいと、Web サイトが使用できなくなる可能性があります。

この値は、httpRuntime要素のmaxQueryStringLength属性を設定することで、構成ファイルで設定できます。 詳細については、「 httpRuntime 要素 (ASP.NET 設定スキーマ)」を参照してください。

クエリ文字列の長さを制御する IIS 設定もあります。 要求制限 <requestLimits> のmaxQueryString属性を参照してください。

適用対象