ControlParameter Class
Binds the value of a property of a Control to a parameter object.
Assembly: System.Web (in System.Web.dll)
| Name | Description | |
|---|---|---|
![]() | ControlParameter() | Initializes a new unnamed instance of the ControlParameter class. |
![]() | ControlParameter(ControlParameter) | Initializes a new instance of the ControlParameter class with values from the specified instance. |
![]() | ControlParameter(String, DbType, String, String) | Initializes a new instance of the ControlParameter class by using the specified parameter name, database type, control ID, and property name. |
![]() | ControlParameter(String, String) | Initializes a new named instance of the ControlParameter class, using the specified control name to identify which control to bind to. |
![]() | ControlParameter(String, String, String) | Initializes a new named instance of the ControlParameter class, using the specified property name and control name to identify which control to bind to. |
![]() | ControlParameter(String, TypeCode, String, String) | Initializes a new named and strongly typed instance of the ControlParameter class, using the specified property name and control name to identify which control to bind to. |
| Name | Description | |
|---|---|---|
![]() | ControlID | Specifies the name of the control that the ControlParameter object binds to. |
![]() | ConvertEmptyStringToNull | Gets or sets a value indicating whether the value that the Parameter object is bound to should be converted to null if it is String.Empty.(Inherited from Parameter.) |
![]() | DbType | Gets or sets the database type of the parameter.(Inherited from Parameter.) |
![]() | DefaultValue | |
![]() | Direction | |
![]() | IsTrackingViewState | |
![]() | Name | Gets or sets the name of the parameter.(Inherited from Parameter.) |
![]() | PropertyName | Gets or sets the property name of the control identified by the ControlID property that the ControlParameter object binds to. |
![]() | Size | Gets or sets the size of the parameter.(Inherited from Parameter.) |
![]() | Type | Gets or sets the type of the parameter.(Inherited from Parameter.) |
![]() | ViewState |
| Name | Description | |
|---|---|---|
![]() | Clone() | Returns a duplicate of the current ControlParameter instance.(Overrides Parameter.Clone().) |
![]() | Equals(Object) | Determines whether the specified object is equal to the current object.(Inherited from Object.) |
![]() | Evaluate(HttpContext, Control) | Updates and returns the value of the ControlParameter object.(Overrides Parameter.Evaluate(HttpContext, Control).) |
![]() | Finalize() | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.) |
![]() | GetDatabaseType() | |
![]() | GetHashCode() | Serves as the default hash function. (Inherited from Object.) |
![]() | GetType() | |
![]() | LoadViewState(Object) | Restores the data source view's previously saved view state.(Inherited from Parameter.) |
![]() | MemberwiseClone() | |
![]() | OnParameterChanged() | Calls the OnParametersChanged method of the ParameterCollection collection that contains the Parameter object.(Inherited from Parameter.) |
![]() | SaveViewState() | |
![]() | SetDirty() | |
![]() | ToString() | Converts the value of this instance to its equivalent string representation.(Inherited from Parameter.) |
![]() | TrackViewState() |
| Name | Description | |
|---|---|---|
![]() ![]() | ICloneable.Clone() | |
![]() ![]() | IStateManager.LoadViewState(Object) | This API supports the product infrastructure and is not intended to be used directly from your code. Restores the data source view's previously saved view state.(Inherited from Parameter.) |
![]() ![]() | IStateManager.SaveViewState() | |
![]() ![]() | IStateManager.TrackViewState() | |
![]() ![]() | IStateManager.IsTrackingViewState |
You can use the ControlParameter class to bind the value of a Control property, such as SelectedValue or SelectedIndex, to a parameter that is used in a parameterized SQL query, business object method, or filtering expression.
The ControlParameter class provides two properties in addition to those inherited from the Parameter class: ControlID and PropertyName. The ControlID property identifies which Control instance to bind to and the PropertyName property identifies the public property of the Control from which the ControlParameter class retrieves a value.
The following code example demonstrates how to use a ControlParameter object to bind data displayed in a ListBox control to the selected value of a DropDownList control in a declarative scenario. The ControlParameter object is added to the SelectParameters collection of the SqlDataSource control on the form, and corresponds to the "@Title" placeholder text in the SelectCommand property.
Available since 2.0
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.






