首页 > 代码库 > DTCMS 新建下拉列表控件
DTCMS 新建下拉列表控件
初始化的时候:
ddlpmzcName.DataSource = new DTcms.BLL.auction().GetpmzcName();
ddlpmzcName.DataTextField = "title";
ddlpmzcName.DataValueField = "id";
ddlpmzcName.DataBind();
注:ddlpmzcName是控件的ID
修改初始化的时候的绑定是:
BLL.production bll = new BLL.production();
Model.production model = bll.GetModel(_id);
ddlCategoryId.SelectedValue = http://www.mamicode.com/model.category_id.ToString();
ddlpmzcName.DataSource = new DTcms.BLL.auction().GetpmzcName();
ddlpmzcName.DataTextField = "title";
ddlpmzcName.DataValueField = "id";
ddlpmzcName.DataBind();
if (!string.IsNullOrEmpty(model.pmzc))
{
ddlpmzcName.SelectedValue = http://www.mamicode.com/model.pmzc.ToString();
}
DTCMS 新建下拉列表控件