关闭

DropDownList 后台绑定

714人阅读 评论(0) 收藏 举报

protected void SetDDLStock()
        {
            List<ListItem> listStock = new List<ListItem> {
                new ListItem("========","========"),
                new ListItem("A股卖方","A股卖方"),
                new ListItem("A股买方","A股买方"),
                new ListItem("H股","H股"),
                new ListItem("外行源文","外行源文"),
                new ListItem("新股定价","新股定价"),
                new ListItem("创业板","创业板")
            };
            this.ddlStock.DataSource = listStock;
            this.ddlStock.DataTextField = "text";
            this.ddlStock.DataValueField = "value";
            this.ddlStock.SelectedValue = "A股卖方";//设置默认选择值
            this.ddlStock.DataBind();
        }

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:74204次
    • 积分:1044
    • 等级:
    • 排名:千里之外
    • 原创:26篇
    • 转载:14篇
    • 译文:0篇
    • 评论:12条
    文章分类
    博客园