ASP.NET HTML 控件 SortedList DropDownList
asp.net html 控件 sortedlist dropdownlist
<script runat="server">
sub page_load
if not page.ispostback then
dim mycountries=new sortedlist
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 sortedlist
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 Web Pages 图表
- ASP.NET Razor VB 变量
- ASP.NET MVC 简介
- ASP.NET MVC 页面和布局
- ASP.NET MVC 数据库
- ASP.NET 服务器控件
- ASP.NET Web 表单
- ASP.NET ValidationSummary 控件
- ASP.NET AdRotator 控件
- ASP.NET CalendarDay 控件
- ASP.NET LinkButton 控件
- ASP.NET PlaceHolder 控件
- ASP.NET TableCell 控件
- HTML Button
- HTML Image
- HTML InputRadiobutton
- Button
- ASP.NET HTML 控件 Calendar 3
- ASP.NET HTML 控件 Literal
- RadiobuttonList