ComboBox with Submit button (C#)
<%@ Page Language="c#" %>
<script runat="server">
void Page_Load()
{
if (Page.IsPostBack)
lblMessage.Text = "You have selected " + list1.SelectedItem.Value;
}
</script>
<html>
<head>
<title>Drop Down List Example</title>
</head>
<body>
<asp:Label id="lblMessage" runat="server"></asp:Label>
<br />
<form runat="server">
Which city interests you?<br />
<asp:dropdownlist id="list1" runat="server">
<asp:listitem>Madrid</asp:listitem>
<asp:listitem>Oslo</asp:listitem>
<asp:listitem>Lisbon</asp:listitem>
</asp:dropdownlist>
<input type="submit" value="Submit Query" />
</form>
</body>
</html>
Related examples in the same category