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();
}
}
}
}