public class GwBasePage : System.Web.UI.Page { public GwBasePage() { // //TODO: 在此处添加构造函数逻辑 // } /// <summary> /// 重写页面加载事件 /// </summary> /// <param name="e"></param> protected override void OnLoad(EventArgs e) { if (CurrentUser == null) { GoAdminLoginPage(); } base.OnLoad(e); } /// <summary> /// 跳转到登陆页并停止操作 /// </summary> protected void GoAdminLoginPage() { Response.Write("<script>top.location='Login.aspx';</script>"); Response.End(); } /// <summary> /// 得到当前登陆用户 /// </summary> public CN_T_Admin CurrentUser { get { return Session["GWUser"] as CN_T_Admin; } } /// <summary> /// 截取字符串长度 }
需要判断的继承:
public partial class Admin_GW_T_UserLoginIDEdit : GwBasePage