/// <summary> /// 初始化数据 /// </summary> private void InitData() { CMS.DAL.CMS_NewsType dal = new CMS.DAL.CMS_NewsType(); DataTable dt = dal.GetList("").Tables[0]; this.rptClassList.DataSource = dt; this.rptClassList.DataBind(); }
/// <summary> /// 初始化下拉列表 /// </summary> private void InitDropDownList() { CMS.DAL.CMS_NewsType dal = new CMS.DAL.CMS_NewsType(); DataSet ds = dal.GetList(""); this.ddlNewType.Items.Add(new ListItem("<==请选择==>", "0")); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { ListItem item = new ListItem(); item.Text = ds.Tables[0].Rows[i]["CMS_TypeName"].ToString(); item.Value = ds.Tables[0].Rows[i]["ID"].ToString(); this.ddlNewType.Items.Add(item); } }