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 8104085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:44:10+00:00 2026-06-05T23:44:10+00:00

Based on a configuration setting I’d like to direct users to a This site

  • 0

Based on a configuration setting I’d like to direct users to a “This site is currently offline” page. The master page seems like the common place to do that. I originally used this code:

MyConfig config = new MyConfig();

protected void Page_PreInit(object sender, EventArgs e)
{
    if (config.RefuseRequests)
        Response.Redirect("Offline.aspx");
}

A break point here is never hit.

After some digging I came across http://msdn.microsoft.com/en-us/library/dct97kc3.aspx which seems to say a master Page_PreInit is never called. Am I reading that right?

The above code doesn’t show an error in visual studio and it seems like a useful step in the load flow. Are there any conditions where a master page Page_PreInit would be executed?

  • 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-05T23:44:11+00:00Added an answer on June 5, 2026 at 11:44 pm

    While the information out there isn’t as clearly stated as I’d like the practical answer does appear to be “no, a master Page_PreInit() will never be hit.”

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

Sidebar

Related Questions

I'm developing a custom search control and setting its configuration based on this sample
I am setting up a project in VS 2010 based on this guide: http://www.ogre3d.org/tikiwiki/Setting+Up+An+Application+-+Visual+Studio
Based on sbt 0.11.0 documentation available ( Common Tasks wiki page and others) and
I'm trying to configure a class with Annotation based configuration in Spring 3, which
I have been using the new feature of Spring 3.1.1 the java based configuration.
I have a web application that dynamically loads assemblies based on database configuration entries
Is it possible to change the assembly name based on the project configuration? I
Is it possible to convert the following XML configuration to an annotation based one?
I am baffled with the behavior of the DataContractSerializer. Our configuration is XML based.
Based on this , how would you make ignoring parameters more succint? var m

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.