System.Web.HttpUtility.ParseQueryString Method

Parses a query string into a System.Collections.Specialized.NameValueCollection using the specified System.Text.Encoding.

Syntax

public static System.Collections.Specialized.NameValueCollection ParseQueryString (string query, System.Text.Encoding encoding)

Parameters

query
The query string to parse.
encoding
The System.Text.Encoding to use.

Returns

A System.Collections.Specialized.NameValueCollection of query parameters and values.

Remarks

In the returned System.Collections.Specialized.NameValueCollection, URL-encoded characters are decoded and multiple occurrences of the same query string parameter are listed as a single entry with a comma separating each value.

Note:

The HttpUtility.ParseQueryString(string, System.Text.Encoding) method uses query strings that might contain user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements. For more information, see Script Exploits Overview.

Requirements

Namespace: System.Web
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0