在
fx
在fx
public class BasePage:Page
{
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base
}
private void InitializeComponent()
{
this
}
protected void My_Page_Load(object sender
{
// do somthing public
PageLoadEvent(sender
}
protected virtual void PageLoadEvent(object sender
}
public class FooPage:BasePage
{
protected void Page_Load(object sender
{
}
protected override void PageLoadEvent(object sender
{
// do something here
}
}
在fx
但在fx
public class BasePage:Page
{
protected void Page_Load(object sender
{
// do somthing public
PageLoadEvent(sender
}
protected virtual void PageLoadEvent(object sender
}
public class FooPage:BasePage
{
protected void Page_Load(object sender
{
}
protected override void PageLoadEvent(object sender
{
// do something here
}
}
在
有可能在
解決方法
在其他的方法中進行驗證
virtual protected void PageLoadEvent( object sender
{
}
protected override void OnPreInit( EventArgs e )
{
ValidateSession();
base
}
/// <summary>
/// 驗證用戶信息
/// </summary>
public void ValidateSession()
{
//如果後台管理界面超時
if (HttpContext
{
Response
HttpContext
return;
//Response
}
}
From:http://tw.wingwit.com/Article/program/net/201311/11373.html