Table of Contents


aspx:FieldDropDown

This component is an HTML select element, used to view pick-list data types.

<aspx:FieldDropDown runat='server' value='{!Model.Status}'/>
 
If you bind a Pick-list Field to this control, the Pick-list values are automatically added and shown as options on this drop-down. It is also possible to add your option values through "Databind" properties or specify values explicitly, as shown below:
 
<aspx:FieldDropDown runat='server' value='{!Model.Status}'>
     <items>
        <asp:ListItem text='Item1' value='Value1' />
        <asp:ListItem text='Item2' value='Value2' />
    </items>
</aspx:FieldDropDown>

 

If you would like to bind a custom list as a Model to the control, do the following:

<aspx:FieldDropDown runat='server' DataSource='<%#Model.Contacts%>' DataTextField='Name' DataValueField='Id' value='{!Model.ContactId}'/>

 

If you would like to bind a custom list from the DataBag, do the following:

<aspx:FieldDropDown runat='server' DataSource='<%#DataBag.Contacts%>' DataTextField="Name" DataValueField="Id" value='{!Model.ContactId}'/>

 

PropertyDescription
IdThe ID of the HTML element.
ValueBind value containing the name of the object and the field to bind.
LabelLabel of a field within the section.
RequiredA Boolean value that specifies whether this inputField is a required field. If set to true, the user must specify a value for this field. If not selected, this value defaults to false.
HintA Text value that is shown to the user on the right side of the input component to assist the user.
HideLabelA Boolean value that specifies whether this field's label should be visible or not. If set to false, the input component spans across the entire row.
EnabledA boolean that determines whether to show the field or not.
PlaceHolderText is shown inside the input component as a watermark.
WidthThe width of the input component. The value can be provided in pixels or percentages.
DataSourceA List or an Array that will populate the contents of the dropdown.
DataTextFieldA text field used in conjunction with DataSouce. Thisdefines which field should be used to display in the select dropdown.
DataValueFieldA text field used in conjunction with DataSource. This defines what field should be used to populate the value field of the select statement.
IsNullableA boolean that defines whether the field can be null.
HelpTextA text value that displays a small bubble next to the field label. When hovered over, the help text will appear.
ReadOnlyA boolean value that determines whether this field can be set or not.