-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMasterPage.master.cs
40 lines (35 loc) · 1.09 KB
/
MasterPage.master.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class MasterPage : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
Customer cus = (Customer)Session["Customer"];
if (cus != null)
{
aName.InnerText = cus.UserName;
aName.HRef = "user.aspx";
aOut.InnerText = "Logout";
aOut.HRef = "";
}
else
{
aName.InnerText = "用户";
aName.HRef = "user.aspx";
aOut.InnerText = "请登入";
aOut.HRef = "login.html";
}
ShoppingCart Slist = (ShoppingCart)Session["ShoppingCart"];
if (Slist == null)
Slist = new ShoppingCart();
rptMinCart.DataSource = Slist.CartItems;
rptMinCart.DataBind();
CCNum.InnerText = Slist.TotalQuantity.ToString();
MinNum.InnerText = Slist.TotalQuantity.ToString();
MinTotal.InnerText = "$" + Slist.TotalSum.ToString();
}
}