private void LoadProductCategorys() { this.ddlProductCategory.DataTextField = "categoryname"; this.ddlProductCategory.DataValueField = "categoryid"; this.ddlProductCategory.DataSource = ProductCategoryFactory.GetAll(); this.ddlProductCategory.DataBind(); }
//加载 private void LoadListData() { List <ProductCategoryModel> list = new List <ProductCategoryModel>(); DataTable dt = ProductCategoryFactory.GetAll(); BuildCategorys(list, dt, "0"); this.dgProductCategoryList.DataSource = list; this.dgProductCategoryList.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { OdnShop.Core.Business.Security.CheckAdministerAndRedirect(); if (!Page.IsPostBack) { this.ddlSearchCategorys.DataSource = ProductCategoryFactory.GetAll(); this.ddlSearchCategorys.DataBind(); this.ddlSearchCategorys.Items.Insert(0, new ListItem("所有栏目", "0")); LoadListData(); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { this.ddlParentCategory.DataTextField = "categoryname"; this.ddlParentCategory.DataValueField = "categoryid"; this.ddlParentCategory.DataSource = ProductCategoryFactory.GetAll(0); this.ddlParentCategory.DataBind(); this.ddlParentCategory.Items.Insert(0, new ListItem("作为顶级分类", "0")); this.LoadCateData(); int parentid = HYRequest.GetQueryInt("parentid", 0); if (parentid != 0) { this.ddlParentCategory.Items.FindByValue(parentid.ToString()).Selected = true; } } }