// Fill the page with data private void PopulateControls() { // Retrieve DepartmentID from the query string string departmentId = Request.QueryString["DepartmentID"]; // Retrieve CategoryID from the query string string categoryId = Request.QueryString["CategoryID"]; // If browsing a category... if (categoryId != null) { // Retrieve category details and display them CategoryDetails cd = CatalogBLO.GetCategoryDetails(categoryId); catalogTitleLabel.Text = cd.Name; catalogDescriptionLabel.Text = cd.Description; // Set the title of the page this.Title = ShopConfiguration.SiteName + " : Category : " + cd.Name; } // If browsing a department... else if (departmentId != null) { // Retrieve department details and display them DepartmentDetails dd = CatalogBLO.GetDepartmentDetails(departmentId); catalogTitleLabel.Text = dd.Name; catalogDescriptionLabel.Text = dd.Description; // Set the title of the page this.Title = ShopConfiguration.SiteName + " : Department : " + dd.Name; } }
protected void Page_Load(object sender, EventArgs e) { // Load the grid only the first time the page is loaded if (!Page.IsPostBack) { // Load the categories grid BindGrid(); // Get DepartmentID from the query string string departmentId = Request.QueryString["DepartmentID"]; // Obtain the department's name DepartmentDetails dd = CatalogBLO.GetDepartmentDetails(departmentId); string departmentName = dd.Name; // Set controls' properties statusLabel.ForeColor = System.Drawing.Color.Red; locationLabel.Text = "Displaying categories for department <b> " + departmentName + "</b>"; } }