日期:2014-05-18 浏览次数:20434 次
public Web.Mod.VIP vip; protected void Page_Load(object sender, EventArgs e) { if (Session["user"] == null) { PageBase.alert(Page, "登陆超时,请重新登陆", "/VIP/Login.aspx"); return; } vip= (Web.Mod.VIP)Session["user"]; }
<span class="kafeiseleft">欢迎您,<span class="red"><%=vip.Name %></span>, 这是您第 <span class="red2"><%=vip.Count+1 %></span> 次登陆, 您上次登陆时间为: <%=vip.EndTime %>
public Web.Mod.VIP vip; protected void Page_Load(object sender, EventArgs e) { if (Session["user"] == null) { PageBase.alert(Page, "登陆超时,请重新登陆", "/VIP/Login.aspx"); //给VIP 初始化一个值 vip.Name="游客"; vip.Count = 1; vip.EndTime = System.DateTime.Now.ToString("yyyy-MM-dd"); } vip= (Web.Mod.VIP)Session["user"]; }
------解决方案--------------------
private Web.Mod.VIP vip; public Web.Mod.VIP VipInfo { set { vip = value; } get { return vip; } } protected void Page_Load(object sender, EventArgs e) { if (Session["user"] == null) { PageBase.alert(Page, "登陆超时,请重新登陆", "/VIP/Login.aspx"); return; } VipInfo= (Web.Mod.VIP)Session["user"]; }
------解决方案--------------------