protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindData(); DropDownListGoodGategory.DataSource = new GoodGategoryBLL().GetGoodGategory(o => o.State == 1); DropDownListGoodGategory.DataTextField = "Name"; DropDownListGoodGategory.DataValueField = "GoodGategoryID"; DropDownListGoodGategory.DataBind(); DropDownListGoodGategory.Items.Add(new ListItem() { Text = "全部", Value = "0" }); DropDownListGoodGategory.SelectedValue = "0"; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request["state"] != null && Request["state"] == "1") { CheckBoxList_State.Items[0].Selected = true; } BindData(); DropDownListGoodGategory.DataSource = new GoodGategoryBLL().GetGoodGategory(o => o.State == 1); DropDownListGoodGategory.DataTextField = "Name"; DropDownListGoodGategory.DataValueField = "GoodGategoryID"; DropDownListGoodGategory.DataBind(); DropDownListGoodGategory.Items.Add(new ListItem() { Text = "全部", Value = "0" }); DropDownListGoodGategory.SelectedValue = "0"; } }