Share via


HttpRuntimeSection.MaxQueryStringLength Propriété

Définition

Obtient ou définit la longueur maximale possible, en nombre de caractères, d'une chaîne de requête dans une requête 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

Valeur de propriété

Longueur maximale de la chaîne de requête, exprimée en nombre de caractères. La valeur par défaut est 2048.

Attributs

Remarques

La valeur de la MaxQueryStringLength propriété peut être n’importe quel entier, zéro ou supérieur. Si la longueur d’une chaîne de requête dépasse la limite de taille, ASP.NET retourne un HTTP 400 code (requête incorrecte) status.

Notes

Des valeurs extrêmement petites peuvent rendre un site web inutilisable.

Vous pouvez définir cette valeur dans un fichier de configuration en définissant l’attribut maxQueryStringLength de l’élément httpRuntime . Pour plus d’informations, consultez élément httpRuntime (schéma des paramètres ASP.NET).

Notes

Il existe également un paramètre IIS qui contrôle la longueur de chaîne de requête. Consultez l’attribut maxQueryString dans Request Limits <requestLimits>.

S’applique à