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

  • Home
  • SEARCH
  • 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 131825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:09:59+00:00 2026-05-11T06:09:59+00:00

In ASP.NET, if I override a page lifecycle event, should I call its base

  • 0

In ASP.NET, if I override a page lifecycle event, should I call its base method before or after doing my work? Does it even matter?

protected override void OnPreRender(EventArgs e) {     // My code goes here     base.OnPreRender(e);     // Or here } 
  • 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. 2026-05-11T06:09:59+00:00Added an answer on May 11, 2026 at 6:09 am

    Yes you should care. Let’s say for a moment that you need to insert a new base class in all of those pages. To me it’s easier to just go ahead and call the base methods than have to do a lot of refactoring later.

    Then again, maybe you don’t need to do that.

    EDIT
    Based on the edit to the question here’s some more info:

    Yes, you should care. Sometimes you want the base classes method to fire before yours (in case of constructors), and sometimes you want it to fire after yours (destructors).

    It may mean the difference between whether a property or object is available or not at the time your code gets to it.

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

Sidebar

Related Questions

In ASP.NET MVC, how to get the page content before render, we know in
I am using Page.ClientScript.RegisterHiddenField(hf_Name,value) in an ASP.net application, how to override or assign a
I have an asp.net page in an iframe where all links target _blank <base
What is the best practice to dispose IDisposable members of an ASP.net page? Should
In an ASP.NET MVC3 application I have a base controller where I override some
I'd like to override the Serialize methods of the ASP.NET JavaScriptSerializer class. Nothing too
I want to override a string from a System.ComponentModel.DataAnnotations for an ASP.NET project. Do
I wondered if/how I can override the default [Authorize] behavior in ASP.NET MVC. I
I have a class named PageBase inheriting from ASP.NET Page . I want to
I have a DropDownList on an ASP.NET page that gets populated by a SQL

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.