Set static value for a combobox (asp:dropdownlist) (VB.net) : ComboBox « Asp Control « ASP.Net






Set static value for a combobox (asp:dropdownlist) (VB.net)

<%@ Page Language=VB Debug=true %>
<HTML>
<HEAD>
<TITLE>Creating a Basic DropDownList Control</TITLE>
</HEAD>
<form runat="server">
<BR><BR>
Select a Color:<BR>
<BR><BR>
<asp:dropdownlist id="ddl1" runat="server">
    <asp:listitem value="Bu">Blue</asp:listitem>
    <asp:listitem value="Re">Red</asp:listitem>
    <asp:listitem value="Gr">Green</asp:listitem>
    <asp:listitem value="Pu" Selected>Purple</asp:listitem>
    <asp:listitem value="Ba">Black</asp:listitem>
    <asp:listitem value="Go" text="Gold"/>
</asp:dropdownlist>
</form>
</BODY>
</HTML>
           
       








Related examples in the same category

1.Get selected item from a ComboBox and check its value (VB.net)
2.Get selected value from a combobox and display (C#)