private void grdProducts_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e) { if (e.Row.RowType == System.Web.UI.WebControls.DataControlRowType.DataRow) { System.Web.UI.WebControls.Literal literal = (System.Web.UI.WebControls.Literal)e.Row.FindControl("litMainCategory"); literal.Text = "-"; object obj2 = System.Web.UI.DataBinder.Eval(e.Row.DataItem, "CategoryId"); if (obj2 != null && obj2 != System.DBNull.Value) { literal.Text = CatalogHelper.GetFullCategory((int)obj2); } ProductCategoriesDropDownList list = (ProductCategoriesDropDownList)e.Row.FindControl("dropAddToCategories"); list.DataBind(); System.Web.UI.WebControls.Literal literal2 = (System.Web.UI.WebControls.Literal)e.Row.FindControl("litExtendCategory"); literal2.Text = "-"; object obj3 = System.Web.UI.DataBinder.Eval(e.Row.DataItem, "ExtendCategoryPath"); if (obj3 != null && obj3 != System.DBNull.Value) { string s = (string)obj3; if (s.Length > 0) { s = s.Substring(0, s.Length - 1); if (s.Contains("|")) { s = s.Substring(s.LastIndexOf('|') + 1); } literal2.Text = CatalogHelper.GetFullCategory(int.Parse(s)); list.SelectedValue = new int?(int.Parse(s)); } } } }
protected void Page_Load(object sender, System.EventArgs e) { //if (!this.Page.IsPostBack) //{ // this.ddlType.BindEnum<EcShop.Entities.VShop.LocationType>("Topic");//修改1 // dropCategories.DataBind(); // dropImportSourceType.DataBind(); //} if (int.TryParse(base.Request.QueryString["Id"], out this.id)) { if (!this.Page.IsPostBack) { this.ddlType.BindEnum <EcShop.Entities.VShop.LocationType>("");//修改1 dropCategories.DataBind(); dropImportSourceType.DataBind(); dropBrandTypes.DataBind(); if (id != 0) { this.Restore(); } return; } } else { base.Response.Redirect("ManageCheapProduct.aspx"); } }
protected void Page_Load(object sender, System.EventArgs e) { if (!this.Page.IsPostBack) { this.ddlType.BindEnum <EcShop.Entities.VShop.LocationType>("VipCard");//修改1 this.BindIcons(); dropCategories.DataBind(); dropImportSourceType.DataBind(); } }
protected void Page_Load(object sender, System.EventArgs e) { if (int.TryParse(base.Request.QueryString["Id"], out this.id)) { if (!this.Page.IsPostBack) { this.ddlType.BindEnum <EcShop.Entities.VShop.LocationType>("VipCard");//修改1 dropCategories.DataBind(); dropImportSourceType.DataBind(); this.BindIcons(); this.Restore(); return; } } else { base.Response.Redirect("ManageNavigate.aspx"); } }