ASP.NET DropdownList Control.
Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)
The ASP.NET dropdown list is a control that allows the user to select a single item from a list of items. The control is rendered as an HTML select control. Each item with the DropdownList control is a
HTML option element.
Working example.
Creating the DropDownList Control.
< asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem>DELL</asp:ListItem>
<asp:ListItem>HP Computers</asp:ListItem>
<asp:ListItem>SONY</asp:ListItem>
</asp:DropDownList>
The above example will be rendered as HTML with the result below (source).
<select name="ctl00$ContentPlaceHolder1$DropDownList1" id="ctl00_ContentPlaceHolder1_DropDownList1"> <option value="DELL">DELL</option> <option value="HP Computers">HP Computers</option> <option value="SONY">SONY</option></select>
|