Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9222283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:48:10+00:00 2026-06-18T03:48:10+00:00

I am able to hook the event and also allowed to override load and

  • 0

I am able to hook the event and also allowed to override load and init.., events in my aspx codebehind file. I have following questions.

public partial class Default : System.Web.UI.Page
{
    public Default()
    {
        this.Init += Default_Init;
        this.Load+=Default_Load;
    }    
    protected void Default_Load(object sender, EventArgs e)
    {        }    
    protected void Default_Init(object sender, EventArgs e)
    {        }    
    protected override void OnLoad(EventArgs e)
    {        }
    protected override void OnInit(EventArgs e)
    {        }
}

Qs:

  1. Why such option(both virtual method and event handler) is exist in Page class?
  2. When override methods got executed, my event handlers(Default_Load and Default_Init) are not executed. what is the reason behind?
  3. Should i call base.OnLoad(e); in overridden OnLoad method? Why should/shouldn’t I?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T03:48:11+00:00Added an answer on June 18, 2026 at 3:48 am
    1. By default, OnInit and OnLoad are not handlers of Init and Load events. They are used to Fire Init and Load events.

    2. When you override, you change the behavior of these methods thus, events are not fired by OnInit and OnLoad methods (unless you explicitly write base.OnInit etc.)

    3. If you change the behavior of OnLoad and do not call base method, then you may break the page lifecycle of asp.net application. For instance, Load event will not be called.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I can hook into a Win32 process, will I be able to do:
recently I have been encountering problems with exposing events from .NET to COM. I
There's already a lot of blog posts out there about being able to hook
So, I have a plugin to an MFC program. I'm using a mouse event
Right now I have a Java application running WMI querying event logs, this is
I am using entity registrations to let users register to an event. I have
I'm trying to hook into the hook_views_post_execute event in Drupal 7, my module called
I have the following setup within my project... A multi project gradle build for
Is there a way to hook up the BackKeyPressed event to a command in
I've searched several questions here and haven't been able to get the answer, so

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.