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. scrapy_redis使用介绍

    scrapy_redis是一个基于redis的scrapy组件,通过它可以快速实现简单的分布式爬虫程序,该组件主要提供三大功能: (1)dupefilter——URL去重规则(被调度器使用) (2)s ...

  2. XV6文件系统

    文件系统 文件系统的目的是组织和存储数据,典型的文件系统支持用户和程序间的数据共享,并提供数据持久化的支持(即重启之后数据仍然可用). xv6 的文件系统中使用了类似 Unix 的文件,文件描述符,目 ...

  3. [luoguP3068] [USACO13JAN]派对邀请函Party Invitations(stl大乱交)

    传送门 记录每一个编号在那些组中,可以用vector,这里选择链式前向星. 每一组用set 将被邀请的放到queue中 #include <set> #include <queue& ...

  4. hdu 4539

    #include<stdio.h> #include<string.h> ]; int s]; int main() { int i,j,n,m; int ch; while( ...

  5. iOS时钟,秒针扫秒样式

    昨天做一个时钟小demo,发现了一些问题. 描述能力有限,我封装好了一个时钟框架,朋友们可以参考      https://github.com/qianlishun/ClockView 点击这里可以 ...

  6. msp430入门编程43

    msp430中C语言的人机交互--菜单公共函数

  7. CodeForces 599A Patrick and Shopping

    水题.每种情况取最小值即可. #include<cstdio> #include<cstring> #include<cmath> #include<algo ...

  8. winServer-常用winrm命令

    学习WinServer必须学习powershell,学习powershell必须掌握远程管理服务器的方法,所以必须学会winrm来远程管理服务器 记录一些常用的winrm命令和错误 常用命令 //在P ...

  9. 转 从头到尾彻底解析Hash表算法

    出处:http://blog.csdn.net/v_JULY_v.   说明:本文分为三部分内容,     第一部分为一道百度面试题Top K算法的详解:第二部分为关于Hash表算法的详细阐述:第三部 ...

  10. java多线程编程01---------基本概念

    一. java多线程编程基本概念--------基本概念 java多线程可以说是java基础中相对较难的部分,尤其是对于小白,次一系列文章的将会对多线程编程及其原理进行介绍,希望对正在多线程中碰壁的小 ...