System.Web.UI.WebControls.Parameter Class

Provides a mechanism that data source controls use to bind to application variables, user identities and choices, and other data. Serves as the base class for all ASP.NET parameter types.

See Also: Parameter Members


public class Parameter : ICloneable, System.Web.UI.IStateManager


The System.Web.UI.WebControls.Parameter class represents a parameter in a parameterized SQL query, a filtering expression, or a business object method call that an ASP.NET data source control uses to select, filter, or modify data. System.Web.UI.WebControls.Parameter objects are contained in a System.Web.UI.WebControls.ParameterCollection object. System.Web.UI.WebControls.Parameter objects are evaluated at run time, to bind the values of the variables they represent to whatever method is used by a data source control to interact with data.

Use classes that derive from System.Web.UI.WebControls.Parameter with data source and data-bound controls to build Web-based data applications. These parameter classes are used by data source controls to bind specific kinds of values found in Web applications to placeholders in SQL query strings, business object method parameters, and more. The following table lists parameter types that are included in ASP.NET.


Binds any public property of a Web server control.


Binds a form field.


Binds a session-state field.


Binds a route URL parameter.


Binds a cookie field.


Binds a query-string parameter.


Binds a profile field.

Extend the base System.Web.UI.WebControls.Parameter class when you want to implement your own custom parameter types.

System.Web.UI.WebControls.Parameter objects are very simple: they have a Parameter.Name and a Parameter.Type property, can be represented declaratively, and can track state across multiple HTTP requests. All parameters support a Parameter.DefaultValue property, for cases when a parameter is bound to a value, but the value evaluates to null at run time.

When using a collection of System.Web.UI.WebControls.Parameter objects with a data source control, their order in the collection might matter. For more information on how parameters are used, see Using the SqlDataSource and AccessDataSource Controls with Parameters and Using Parameters with the ObjectDataSource Control.


Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions:
Since: .NET 2.0