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
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.
System.Web.UI.WebControls.ControlParameter |
Binds any public property of a Web server control. |
System.Web.UI.WebControls.FormParameter |
Binds a form field. |
System.Web.UI.WebControls.SessionParameter |
Binds a session-state field. |
System.Web.UI.WebControls.RouteParameter |
Binds a route URL parameter. |
System.Web.UI.WebControls.CookieParameter |
Binds a cookie field. |
System.Web.UI.WebControls.QueryStringParameter |
Binds a query-string parameter. |
System.Web.UI.WebControls.ProfileParameter |
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.