asp.net webform 自定义 select 绑定数值

前台:

 <select id="ddlAddedItemType" runat="server">
        <option value="">请选择</option>
 </select>

后台:

public void ddlItemTypeBind()
 {
            DataSet dsaddeditemtype = addeditemtypeBLL.GetList("");
            this.ddlAddedItemType.DataSource = dsaddeditemtype;
            this.ddlAddedItemType.DataTextField = "ItemTypeName";
            this.ddlAddedItemType.DataValueField = "ID";
            this.ddlAddedItemType.DataBind();
            this.ddlAddedItemType.Items.Insert(0,new ListItem("请选择",""));  //自定义一个值
 }

 

posted @ 2017-06-02 10:26  幽冥狂_七  阅读(2361)  评论(0编辑  收藏  举报