https://stackoverflow.com/questions/2737092/how-to-execute-page-load-in-pages-base-class

We faced the similar problem, All you need to do is just register the handler in the constructor. :)

public class FactsheetBase : System.Web.UI.Page
{ public FactsheetBase()
{
this.Load += new EventHandler(this.Page_Load);
} public MyPageData Data { get; set; }
protected void Page_Load(object sender, EventArgs e)
{
// get data that's common to all implementors of FactsheetBase
// and store the values in FactsheetBase's properties
this.Data = ExtractPageData(Request.QueryString["data"]);
}
}

Another approach would be to override OnLoad() which is less preferred.

public class FactsheetBase : System.Web.UI.Page
{ public FactsheetBase()
{
} public MyPageData Data { get; set; }
protected override void OnLoad(EventArgs e)
{
//your code
// get data that's common to all implementors of FactsheetBase
// and store the values in FactsheetBase's properties
this.Data = ExtractPageData(Request.QueryString["data"]); base.OnLoad(e);
}
}

How to Execute Page_Load() in Page's Base Class?的更多相关文章

  1. Optimizing TLB entries for mixed page size storage in contiguous memory

    A system and method for accessing memory are provided. The system comprises a lookup buffer for stor ...

  2. ExecutorService中submit和execute的区别(转)

    在Java5之后,并发线程这块发生了根本的变化,最重要的莫过于新的启动.调度.管理线程的一大堆API了.在Java5以后,通过Executor来启动线程比用Thread的start()更好.在新特征中 ...

  3. ASP.NET Page执行顺序【转】

    一.ASP.NET 母版页和内容页中的事件 母版页和内容页都可以包含控件的事件处理程序.对于控件而言,事件是在本地处理的,即内容页中的控件在内容页中引发事件,母版页中的控件在母版页中引发事件.控件事件 ...

  4. ExecutorService中submit和execute的区别

    在Java5之后,并发线程这块发生了根本的变化,最重要的莫过于新的启动.调度.管理线程的一大堆API了.在Java5以后,通过Executor来启动线程比用Thread的start()更好.在新特征中 ...

  5. Kooboo中怎么写Page Plugin -摘自官方文档

    Page plugin development Page plugin is an add-on to Kooboo CMS, and is responsible for making data s ...

  6. 多线程ExecutorService中submit和execute区别

    submit和execute都是 ExecutorService 的方法,都是添加线程到线程池中. 区别 三个区别: 1.接收的参数不一样 2.submit有返回值,而execute没有 Method ...

  7. ExecutorService中submit和execute的区别<转>

    在Java5之后,并发线程这块发生了根本的变化,最重要的莫过于新的启动.调度.管理线程的一大堆API了.在Java5以后,通过Executor来启动线程比用Thread的start()更好.在新特征中 ...

  8. ExecutorService的execute和submit方法

    三个区别: 1.接收的参数不一样 2.submit有返回值,而execute没有 Method submit extends base method Executor.execute by creat ...

  9. PatentTips - Maintaining shadow page tables in a sequestered memory region

    BACKGROUND Malicious code, known as malware, which includes viruses, worms, adware, etc., may attack ...

随机推荐

  1. PTA 04-树6 Complete Binary Search Tree (30分)

    题目地址 https://pta.patest.cn/pta/test/16/exam/4/question/669 5-7 Complete Binary Search Tree   (30分) A ...

  2. MacOS & iOS

    MacOS & iOS https://github.com/qinjx/30min_guides/blob/master/ios.md https://www.cnblogs.com/xgq ...

  3. python学习笔记--面向对象的编程和类

    一.面向对象的编程 面向对象程序设计--Object Oriented Programming,简称oop,是一种程序设计思想.二.面向对象的特性类:class类,对比现实世界来说就是一个种类,一个模 ...

  4. [BZOJ2120][BZOJ2453]数颜色

    [BZOJ2120]数颜色 试题描述 墨墨购买了一套N支彩色画笔(其中有些颜色可能相同),摆成一排,你需要回答墨墨的提问.墨墨会像你发布如下指令: 1. Q L R代表询问你从第L支画笔到第R支画笔中 ...

  5. Pollard rho模板

    #include<cstdio> #include<cstring> #include<cstdlib> #include<algorithm> #in ...

  6. 在eclipse中画类图

    学习设计模式的时候,希望能够画出类图,理清关系.但是StarUML还有重新去写类名.属性.方法等,不是很方便.网上给出了安装插件的方法额,就可以直接在eclipse中拖拽类,很方便.但是网上给出的插件 ...

  7. POJ 2438 哈密顿回路

    Children's Dining Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 4730   Accepted: 754 ...

  8. 洛谷——P3119 [USACO15JAN]草鉴定Grass Cownoisseur

    P3119 [USACO15JAN]草鉴定Grass Cownoisseur 题目描述 In an effort to better manage the grazing patterns of hi ...

  9. [Bzoj1821][JSOI2010]Group 部落划分 Group(并查集)(二分答案)

    1821: [JSOI2010]Group 部落划分 Group Time Limit: 10 Sec  Memory Limit: 64 MBSubmit: 2949  Solved: 1392[S ...

  10. java 返回json数据

    Student st1 = new Student(1, "dg", 18, new Date());            Student st2 = new Student(2 ...