private void PopulateBrandCategoryInfo(int brandCategoryId)
        {
            BrandCategory brandCategory = BrandService.GetBrandCategoryById(brandCategoryId);

            if (brandCategory != null)
            {
                txtName.Text   = Server.HtmlDecode(brandCategory.Name);
                txtDesc.Text   = Server.HtmlDecode(brandCategory.Description);
                txtUrlKey.Text = brandCategory.UrlRewrite;

                if (brandCategory.ImageUrl == string.Empty)
                {
                    imgThumbnail.Visible  = false;
                    cbRemoveThumb.Visible = false;
                }
                else
                {
                    imgThumbnail.Src      = "/get_image_handler.aspx?type=brand&img=" + brandCategory.ImageUrl;
                    imgThumbnail.Visible  = true;
                    cbRemoveThumb.Visible = true;
                }

                cbVisible.Checked = brandCategory.Visible;
                hfParent.Value    = brandCategory.ParentId.ToString();

                if (brandCategory.ParentId != AppConstant.DEFAULT_BRAND_CATEGORY)
                {
                    ltlParent.Text = BrandService.GetBrandCategoryById(brandCategory.ParentId).Name;
                }
            }

            SetState(BRAND_CATEGORY_ID, brandCategoryId);

            if (GetIntState(BRAND_CATEGORY_ID) == AppConstant.DEFAULT_BRAND_CATEGORY)
            {
                SetState(MODE, NEW);
                SetState(CHOSEN_FILTER, ANY);
            }
            else
            {
                SetState(MODE, EDIT);
                SetState(CHOSEN_FILTER, YES);
            }

            LoadProducts();

            hfCurrentPanel.Value = "general";
        }
        protected override void OnPreRenderComplete(EventArgs e)
        {
            if (GetIntState(BRAND_CATEGORY_ID) == AppConstant.DEFAULT_BRAND_CATEGORY)
            {
                lbDeleteBrandCategory.Visible = false;
                ltlTitle.Text = "New Brand Category";
            }
            else
            {
                var brandCategoryId = GetIntState(BRAND_CATEGORY_ID);
                var brandCategory   = BrandService.GetBrandCategoryById(brandCategoryId);

                if (brandCategory != null)
                {
                    lbDeleteBrandCategory.Visible = true;
                    ltlTitle.Text = string.Format("{0} (ID: {1})", brandCategory.Name, GetIntState(BRAND_CATEGORY_ID).ToString());
                }
            }

            base.OnPreRenderComplete(e);
        }