Created
November 6, 2012 10:08
-
-
Save hatelove/4023837 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// GrandFather 的摘要描述 | |
/// </summary> | |
public class GrandFather : System.Web.UI.Page | |
{ | |
protected virtual int GetExpireMinutes() | |
{ | |
return 480; | |
} | |
protected override void OnPreInit(EventArgs e) | |
{ | |
base.OnPreInit(e); | |
Response.Write("GrandFather Page_PreInit" + "<br/>"); | |
var minutes = this.GetExpireMinutes(); | |
Response.Write(string.Format("expire minutes:{0}", minutes) + "<br/>"); | |
} | |
} | |
/// <summary> | |
/// Father 的摘要描述 | |
/// </summary> | |
public class Father : GrandFather | |
{ | |
protected override void OnPreInit(EventArgs e) | |
{ | |
base.OnPreInit(e); | |
Response.Write("Father Page_PreInit" + "<br/>"); | |
} | |
} | |
//個別設定的子頁面 | |
public partial class Sample : Father | |
{ | |
protected override int GetExpireMinutes() | |
{ | |
return 10; | |
} | |
protected void Page_PreInit(object sender, EventArgs e) | |
{ | |
Response.Write("Sample Page_PreInit" + "<br/>"); | |
} | |
protected void Page_Load(object sender, EventArgs e) | |
{ | |
} | |
} | |
//預設的子頁面 | |
public partial class _Default : Father | |
{ | |
protected void Page_Load(object sender, EventArgs e) | |
{ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment