Gets or sets the name of the query-string field that the parameter binds to.
Assembly: System.Web (in System.Web.dll)
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.property identifies a name/value pair that is passed with the query string. The property identifies the name of the pair, whereas the
The following example shows how to use a QueryStringParameter object together with a SqlDataSource control to display data in a ListBox control. The 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.
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.
Available since 2.0