ASP.NET HTML 控件 DropdownList

asp.net html 控件 dropdownlist

<script  runat="server">
sub submit(sender as object, e as eventargs)
   mess.text="you selected " & drop1.selecteditem.text
end sub
</script>


<!doctype html>
<html>
<body>

<form runat="server">
<asp:dropdownlist id="drop1" runat="server">
<asp:listitem>item 1</asp:listitem>
<asp:listitem>item 2</asp:listitem>
<asp:listitem>item 3</asp:listitem>
<asp:listitem>item 4</asp:listitem>
<asp:listitem>item 5</asp:listitem>
<asp:listitem>item 6</asp:listitem>
</asp:dropdownlist>
<asp:button text="submit" onclick="submit" runat="server"/>
<p><asp:label id="mess" runat="server"/></p>
</form>

</body>
</html>

相关文章