protected void BrandDropDownList1_SelectedIndexChanged(object sender, EventArgs e) { int brandId = BrandDropDownList1.SelectedId; SourceCategoryDropDownList.RefreshFromBrand(brandId); TargetCategoryDropDownList.RefreshFromBrand(brandId); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { string s = (Session["BulkAction_DefaultCategoryId"] == null) ? "0" : Session["BulkAction_DefaultCategoryId"].ToString(); bool delete = (Session["BulkAction_DeleteCategory"] == null) ? false : Convert.ToBoolean(Session["BulkAction_DeleteCategory"]); Session.Remove("BulkAction_DefaultCategoryId"); Session.Remove("BulkAction_DeleteCategory"); int defaultCategoryId = NumericUtils.ParseInt32(s, 0); if (defaultCategoryId > 0) { Category category = CategoryCache.Instance.GetById(defaultCategoryId); BrandDropDownList1.SafeSelectValue(category.BrandId); SourceCategoryDropDownList.RefreshFromBrandAndSelect(BrandDropDownList1.SelectedId, defaultCategoryId); TargetCategoryDropDownList.RefreshFromBrand(BrandDropDownList1.SelectedId); if (delete) { DeleteSourceCategoryCheckBox.Checked = true; CancelButton.RedirectUrl = ResolveUrl("~/Admin/Content/ManageCategories.aspx?BrandId=" + category.BrandId); } } } }