protected override void OnPreInit(EventArgs e) { base.OnPreInit(e); Apq.STReturn stReturn = new Apq.STReturn(); if (!CheckLoginPage.CheckLogin(ref stReturn, ApqSession)) { urlLogin = "******"; } }
protected void Page_Load(object sender, EventArgs e) { STReturn stReturn = new STReturn(); HttpSessionState ApqSession = new HttpSessionState(Session); if (CheckLoginPage.CheckLogin(ref stReturn, ApqSession)) { txtUserName.Text = ApqSession.User.Rows[0]["UserName"].ToString(); } else { ClientScript.RegisterStartupScript(this.GetType(), "scdtxc_CheckLogin", @" alert(""请登录""); top.location = ""Login.aspx""; ", true); } }