实训项目设计步骤01

1、实体类设计

2、数据访问类设计

3、母板的后台设计(未登录用户要转到登录页面,登录用户显示姓名)

4、登录页面后台设计(session名称与母板页的相同)

5、退出(一般应用程序contex)

            context.Session.Abandon();  //取消会话,要引入using System.Web.SessionState空间,以实现IRequiresSessionState接口

 1 using System;
 2 using System.Collections.Generic;
 3 using System.Linq;
 4 using System.Web;
 5 using System.Web.SessionState;
 6 
 7 namespace HotelWebProject.Adminhyl.handlers
 8 {
 9     /// <summary>
10     /// ExitSys 的摘要说明
11     /// 该类必需引入命名空间:System.Web.SessionState;
12     /// 同时必须实现标记接口:IRequiresSessionState;
13     /// </summary>
14     public class ExitSys : IHttpHandler ,IRequiresSessionState
15     {
16 
17         public void ProcessRequest(HttpContext context)
18         {
19             context.Response.ContentType = "text/plain";
20             context.Session.Abandon();  //取消会话,要引入using System.Web.SessionState空间,以实现IRequiresSessionState接口
21             context.Response.Redirect("~/Adminhyl/AdminLogin.aspx");
22         }
23 
24         public bool IsReusable
25         {
26             get
27             {
28                 return false;
29             }
30         }
31     }
32 }
原文地址:https://www.cnblogs.com/atlj/p/8109515.html