首页 > 代码库 > asp.net webform 自定义 select 绑定数值

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

前台:

 <select id="ddlAddedItemType" runat="server">
        <option value=http://www.mamicode.com/"">请选择</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("请选择",""));  //自定义一个值
 }

 

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