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>
結(jié)果:
相關(guān)文章
- ASP.NET Web Pages 布局
- ASP.NET MVC 數(shù)據(jù)庫
- ASP.NET Hashtable
- ASP.NET ValidationSummary 控件
- ASP.NET ImageButton 控件
- WebSecurity IsCurrentUser 方法
- HTML Button
- HTML Inputbutton
- ASP.NET HTML 控件 DataList
- ASP.NET HTML 控件 CustomValidator
- C# 實例 If Else 條件
- VB 實例 Else If 條件
- VB 實例 使用數(shù)據(jù)庫 根據(jù)數(shù)據(jù)庫顯示餅圖
- ASP.NET Calendar SelectionMode 屬性
- ASP.NET Calendar TitleFormat 屬性
- ASP.NET TextBox MaxLength 屬性
- ASP.NET ID 屬性
- 從字符串中返回指定數(shù)目的字符
- 控制緩存
- comparevalidator