ASP.NET HTML 控件 Hashtable DropDownList
asp.net html 控件 hashtable dropdownlist
<script runat="server">
sub page_load
if not page.ispostback then
dim mycountries=new hashtable
mycountries.add("n","norway")
mycountries.add("s","sweden")
mycountries.add("f","france")
mycountries.add("i","italy")
dd.datasource=mycountries
dd.datavaluefield="key"
dd.datatextfield="value"
dd.databind()
end if
end sub
sub displaymessage(s as object,e as eventargs)
lbl1.text="your favorite country is: " & dd.selecteditem.text
end sub
</script>
<!doctype html>
<html>
<body>
<form runat="server">
<asp:dropdownlist id="dd" runat="server"
autopostback="true" onselectedindexchanged="displaymessage" />
<p><asp:label id="lbl1" runat="server" /></p>
</form>
</body>
</html>
sub page_load
if not page.ispostback then
dim mycountries=new hashtable
mycountries.add("n","norway")
mycountries.add("s","sweden")
mycountries.add("f","france")
mycountries.add("i","italy")
dd.datasource=mycountries
dd.datavaluefield="key"
dd.datatextfield="value"
dd.databind()
end if
end sub
sub displaymessage(s as object,e as eventargs)
lbl1.text="your favorite country is: " & dd.selecteditem.text
end sub
</script>
<!doctype html>
<html>
<body>
<form runat="server">
<asp:dropdownlist id="dd" runat="server"
autopostback="true" onselectedindexchanged="displaymessage" />
<p><asp:label id="lbl1" runat="server" /></p>
</form>
</body>
</html>
相关文章
- ASP.NET 教程
- ASP.NET Web Pages 对象
- ASP.NET Web Pages 帮助器
- ASP.NET Web Pages Email
- ASP.NET MVC 模型
- ASP.NET MVC 参考手册
- ASP.NET 导航
- ASP.NET 实例
- ASP.NET RangeValidator 控件
- ASP.NET RegularExpressionValidator 控件
- ASP.NET Calendar 控件
- WebSecurity CurrentUserName 属性
- WebSecurity CreateUserAndAccount 方法
- WebSecurity GetUserId 方法
- HTML Image 2
- HTML Table 2
- ASP.NET HTML 控件 Button 2
- ASP.NET HTML 控件 DataList
- ASP.NET HTML 控件 ImageButton
- ASP.NET HTML 控件 用 重复