catalog.aspx.cs

来自「这是一个基于asp.net的网上气球店」· CS 代码 · 共 39 行

CS
39
字号
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Catalog : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        PopulateControls();
    }
    private void PopulateControls() 
    {
        string departmentId=Request.QueryString["DepartmentID"];
        string CategoryId=Request.QueryString["CategoryID"];
        //如果点击了某个分类(当然门类肯定是同时存在了)
        if(CategoryId!=null)
        {
            CategoryDetails cd = CatalogAccess.GetCategoryDetails(CategoryId);
            CatalogTitleLabel.Text = cd.Name;
            CatalogDescriptionLabel.Text = cd.Description;
            this.Title = BalloonShopConfiguration.SiteName + ":Category:" + cd.Name;
        }
        else if(departmentId!=null)//如果仅仅是点击了某个门类
        {
            DepartmentDetails dd = CatalogAccess.GetDepartmentDetails(departmentId);
            CatalogTitleLabel.Text = dd.Name;
            CatalogDescriptionLabel.Text = dd.Description;
            this.Title = BalloonShopConfiguration.SiteName + ":Department:" + dd.Name;
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?