System.Web.UI.WebControls.ControlParameter.PropertyName Property

Gets or sets the property name of the control identified by the ControlParameter.ControlID property that the System.Web.UI.WebControls.ControlParameter object binds to.

Syntax

[System.ComponentModel.TypeConverter(typeof(System.Web.UI.WebControls.ControlPropertyNameConverter))]
[System.ComponentModel.DefaultValue("")]
public string PropertyName { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

The ControlParameter.PropertyName property identifies the public property of the System.Web.UI.Control object identified by the ControlParameter.ControlID property that the System.Web.UI.WebControls.ControlParameter object binds to at run time. ControlParameter.PropertyName can be set to a simple string, such as "SelectedValue", or an expression using erload:System.Web.UI.DataBinder.Eval syntax to identify complex control properties.

While the ControlParameter.PropertyName property is optional, typically both ControlParameter.ControlID and ControlParameter.PropertyName properties are set for the ControlParameter.Evaluate(System.Web.HttpContext, System.Web.UI.Control) method to correctly bind to a control. If you set the ControlParameter.ControlID property but not the ControlParameter.PropertyName property, the ControlParameter.Evaluate(System.Web.HttpContext, System.Web.UI.Control) method attempts to use the System.Web.UI.ControlValuePropertyAttribute attribute to identify a default ControlParameter.PropertyName property. (It is the responsibility of control authors to specify this attribute.) If this fails, ControlParameter.Evaluate(System.Web.HttpContext, System.Web.UI.Control) throws an ArgumentException exception.

The following table identifies which ASP.NET controls decorate properties with the System.Web.UI.ControlValuePropertyAttribute attribute.

System.Web.UI.WebControls.Calendar

Calendar.SelectedDate

System.Web.UI.WebControls.CheckBox

CheckBox.Checked

System.Web.UI.WebControls.DataList

DataList.SelectedValue

System.Web.UI.WebControls.DetailsView

DetailsView.SelectedValue

System.Web.UI.WebControls.FormView

FormView.SelectedValue

System.Web.UI.WebControls.GridView

GridView.SelectedValue

System.Web.UI.WebControls.Label

Label.Text

System.Web.UI.WebControls.ListControl

ListControl.SelectedValue

System.Web.UI.WebControls.Menu

Menu.SelectedValue

System.Web.UI.WebControls.TextBox

TextBox.Text

System.Web.UI.WebControls.TreeView

TreeView.SelectedValue

Requirements

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