DropDownList 后台绑定

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();
        }

你可能感兴趣的:(创业)