Declaring a DropDownList in ASP .Net:

   A simple declaration for DropDownList can be done as below.

<asp:DropDownList ID="DropDownList1" runat="server">

</asp:DropDownList>

  If we want to add some items statically it can be added inside the Page as follows.

<asp:DropDownList ID="DropDownList1" runat="server">

<asp:ListItem>Select</asp:ListItem>

<asp:ListItem>1</asp:ListItem>

      <asp:ListItem>2</asp:ListItem>

      <asp:ListItem>3</asp:ListItem>

</asp:DropDownList>

Leave Comment