简单的动态添加dropdownlist

<script runat="server">
     void Page_Load(Object sender,EventArgs e){
          ArrayList al = new ArrayList();
          al.Add( "选项1" );
          al.Add( "选项2" );
          al.Add( "选项3" );
          al.Add( "选项4" );
          DropDownList1.DataSource = al ;
          DropDownList1.DataBind();
     }
</script>

<html>
    <head>
    </head>
    <body>
        <asp:DropDownList id="DropDownList1" runat="server" />
    </body>
</html>

你可能感兴趣的:(list)