?? 5-7.aspx
字號:
<html>
<head>
<script language="VB" runat="server">
'再頁面裝載的時候調用的方法:
Sub Page_Load(sender As Object, e As EventArgs)
If Not IsPostBack Then
Dim values as ArrayList= new ArrayList()
values.Add ("北京")
values.Add ("深圳")
values.Add ("上海")
values.Add ("廣州")
values.Add ("南寧")
values.Add ("重慶")
'設定DropDown1的數據源為values,即上面定義的信息
DropDown1.DataSource = values
'數據的綁定
DropDown1.DataBind
End If
End Sub
'提交按鈕響應的方法
Sub select02_Click(sender As Object, e As EventArgs)
Label1.Text = "你的選擇是: " + DropDown1.SelectedItem.Text
End Sub
</script>
</head>
<body BGCOLOR="#FFFFFF">
<br><br><br>
<center>
<h3><font face="Verdana">列表控件實例</font></h3>
</center>
<br><br>
<center>
<form runat=server>
<!--列出列表信息-->
<asp:DropDownList id="DropDown1" runat="server" />
<asp:button Text="提交" OnClick="select02_Click" runat=server/>
<p>
<asp:Label id=Label1 font-name="Verdana" font-size="10pt" runat="server" />
</form>
</center>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -