Listbox

asp.net html 控件 listbox

<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:listbox id="drop1" rows="3" runat="server">
<asp:listitem selected="true">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:listbox>
<asp:button text="submit" onclick="submit" runat="server" />
<p><asp:label id="mess" runat="server" /></p>
</form>

</body>
</html>

相关文章