using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace NCNEWS.Web
{
public class ValidatorPage : System.Web.UI.Page
{
//pageunload事件,并不是指浏览器关闭,而是指页面关闭,所以刷新的时候,依然会执行以下事件
protected void Page_Unload(object sender, EventArgs e)
{
}
protected override void OnPreInit(EventArgs e)
{
base.OnPreInit(e);
if (Session["user"] == null)
{//这里写 跳转到登陆页面:例如:
// Response.Redirect(string.Format("/adminlogin.aspx?page={0}", Server.UrlEncode(Request.Url.ToString())));
Response.Write("<script>window.parent.location.href='"+Xiaobin.Utility.Tool.GetApplicationPath()+"admin/login.aspx'</script>");
Response.End();
}
}
}
}