1using System;
2using System.Collections;
3using System.ComponentModel;
4using System.Data;
5using System.Drawing;
6using System.Web;
7using System.Web.SessionState;
8using System.Web.UI;
9using System.Web.UI.WebControls;
10using System.Web.UI.HtmlControls;
11
12namespace WebApplication1
13{
14 /// <summary>
15 /// WebForm1 的摘要说明。
16 /// </summary>
17 public class WebForm1 : System.Web.UI.Page
18 {
19 private void Page_Load(object sender, System.EventArgs e)
20 {
21 // 在此处放置用户代码以初始化页面
22 AfterLoadPage();
23 }
24 protected virtual void AfterLoadPage()
25 {
26 }
27
28 Web 窗体设计器生成的代码
48 }
49}
50
2using System.Collections;
3using System.ComponentModel;
4using System.Data;
5using System.Drawing;
6using System.Web;
7using System.Web.SessionState;
8using System.Web.UI;
9using System.Web.UI.WebControls;
10using System.Web.UI.HtmlControls;
11
12namespace WebApplication1
13{
14 /// <summary>
15 /// WebForm1 的摘要说明。
16 /// </summary>
17 public class WebForm1 : System.Web.UI.Page
18 {
19 private void Page_Load(object sender, System.EventArgs e)
20 {
21 // 在此处放置用户代码以初始化页面
22 AfterLoadPage();
23 }
24 protected virtual void AfterLoadPage()
25 {
26 }
27
28 Web 窗体设计器生成的代码
48 }
49}
50
how to use:
1using System;
2
3namespace WebApplication1
4{
5 /// <summary>
6 /// Class1 的摘要说明。
7 /// </summary>
8 public class Class1:WebForm1
9 {
10 public Class1()
11 {
12
13 }
14 protected override void AfterLoadPage()
15 {
16 Response.Write("DDDDDDDDDDD");
17 }
18
19 }
20}
21
2
3namespace WebApplication1
4{
5 /// <summary>
6 /// Class1 的摘要说明。
7 /// </summary>
8 public class Class1:WebForm1
9 {
10 public Class1()
11 {
12
13 }
14 protected override void AfterLoadPage()
15 {
16 Response.Write("DDDDDDDDDDD");
17 }
18
19 }
20}
21