Export (0) Print
Expand All

QueryStringParameter.QueryStringField Property

Gets or sets the name of the query-string field that the parameter binds to.

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

member QueryStringField : string with get, set

Property Value

Type: System.String
The name of the query-string field that the parameter binds to.

The QueryStringField property identifies a name/value pair that is passed with the query string. The QueryStringField property identifies the name of the pair, whereas the QueryStringParameter property binds to its corresponding value at run time. If the expected query-string name/value pair is not passed to the page with the query string, the Evaluate method then tries to bind the parameter to the value of the DefaultValue property. If the DefaultValue property is not set, the Evaluate method fails to bind the parameter to a value.

The following example shows how to use a QueryStringParameter object together with a SqlDataSource control to display data in a ListBox control. The QueryStringField property is set to the name of the expected query-string field, and the parameter is added to the SelectParameters collection. A DefaultValue property is provided in case the name/value pair is not passed with the query string.

No code example is currently available or this language may not be supported.

The following example shows how to use a QueryStringParameter object together with a SqlDataSource control to display data in a GridView control. The QueryStringParameter object is added to the SelectParameters collection, together with other parameter objects that are used for the output parameter and return value. To retrieve data, handle the values that are returned from the stored procedure. This code example is part of a larger example that is provided for the SqlDataSourceStatusEventArgs class.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0
Show:
© 2015 Microsoft