ASP

本类阅读TOP10

·asp常用数据库连接方法和技巧
·无组件生成BMP验证码
·一些常用的辅助代码 (网络收藏)
·JavaScript实现的数据表格:冻结列、调整列宽和客户端排序
·VisualStudio.NET_2003及其 MSDN 下载地址
·ASP模拟MVC模式编程
·图片以二进制流输出到网页
·MD5加密算法 ASP版
·ASP.NET编程中的十大技巧
·改进 ASP 的字符串处理性能

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
DropDownList 控件 DataTextField 和 DataValueField 分开绑定

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

<SCRIPT runat="server">

Sub Page_Load

  If Not Page.IsPostBack Then

    Dim URLs = New SortedList()
    URLs.Add("Google", "http://www.google.com")
    URLs.Add("MSN", "http://search.msn.com")
    URLs.Add("Yahoo", "http://www.yahoo.com")
    URLs.Add("Lycos", "http://www.lycos.com")
    URLs.Add("AltaVista", "http://www.altavista.com")
    URLs.Add("Excite", "http://www.excite.com")

    '-- Bind SortedList to controls

    RadioButtons.DataSource = URLs
    RadioButtons.DataTextField = "Key"
    RadioButtons.DataValueField = "Value"
    RadioButtons.DataBind()

    CheckBoxes.DataSource = URLs
    CheckBoxes.DataTextField = "Key"
    CheckBoxes.DataValueField = "Value"
    CheckBoxes.DataBind()

    DropDownList.DataSource = URLs
    DropDownList.DataTextField = "Key"
    DropDownList.DataValueField = "Value"
    DropDownList.DataBind()

    ListBox.DataSource = URLs
    ListBox.DataTextField = "Key"
    ListBox.DataValueField = "Value"
    ListBox.DataBind()

  End If

End Sub

</SCRIPT>
原网站 http://it.maconstate.edu/tutorials/ASPNET/ASPNET07/aspnet07-03.aspx



相关文章

相关软件