案例:ASP.NET案例     状态:不可编辑再运行    进入竖版
 运行结果 
x
 
1
2
<script  runat="server">
3
Sub submit(Sender As Object,e As EventArgs)
4
mess.Text="您选择了:" & drop1.SelectedItem.Text
5
End Sub
6
</script>
7
8
<html>
9
<body>
10
11
<form runat="server">
12
<asp:ListBox id="drop1" rows="3" runat="server">
13
<asp:ListItem selected="true">Item 1</asp:ListItem>
14
<asp:ListItem>Item 2</asp:ListItem>
15
<asp:ListItem>Item 3</asp:ListItem>
16
<asp:ListItem>Item 4</asp:ListItem>
17
<asp:ListItem>Item 5</asp:ListItem>
18
<asp:ListItem>Item 6</asp:ListItem>
19
</asp:ListBox>
20
<asp:Button Text="提交" OnClick="submit" runat="server" />
21
<p><asp:label id="mess" runat="server" /></p>
22
</form>
23
24
</body>
25
</html>
26