DropDownList控件是一个下拉式的选择控件。
<div>
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem>语文</asp:ListItem>
<asp:ListItem>数学</asp:ListItem>
<asp:ListItem>英语</asp:ListItem>
<asp:ListItem>体育</asp:ListItem>
</asp:DropDownList>
<asp:Button ID="Button1" runat="server" Text="确定" onclick="Button1_Click" />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</div>
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = "您选择的课程是:" + DropDownList1.SelectedItem.Text;
}