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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:43:20+00:00 2026-05-11T05:43:20+00:00

We have a requirement to have our ASP.NET MVC websites be automatically closed down

  • 0

We have a requirement to have our ASP.NET MVC websites be automatically closed down by a remote notification (change in database value). Where would be the best place to implement this?

  • Base Controller Class
  • Global.asax
  • Custom attribute
  • Other

Update

Lots of suggestions to use app_offline but this scenario will be happening daily and will be purely initiated by the database so I would rather have the application take the initiative rather than something external push the file in.

Also, I will probably need to redirect the users to a holding page (preferably an MVC controller method to keep everything consistent). I’m leaning more towards catching it in my BaseController and having that handle it

  • 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-11T05:43:21+00:00Added an answer on May 11, 2026 at 5:43 am

    I’m going to answer this myself as I did it a different way but thanks to everyone for their responses.

    What I ended up doing is overriding OnActionExecuting() in my BaseController class (which all my controllers derived from).

    In this method I check the database (using a 1 minute cache) and if the website is closed I load up a view to display a closed message. Code shown below

    Protected Overrides Sub OnActionExecuting(ByVal filterContext As System.Web.Mvc.ActionExecutingContext)             MyBase.OnActionExecuting(filterContext)              Dim _cfgService = ObjectFactory.GetInstance(Of IConfigService)()              If _cfgService.DynamicConfig.WebSiteClosed Then                 filterContext.Result = ErrorHandler(_cfgService.DynamicConfig.WebSiteClosedTitle, _                                                     _cfgService.DynamicConfig.WebSiteClosedMessage)             End If         End Sub 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a business requirement that some users be automatically logged out of our
I have a requirement that we need to make a telephone call using ASP.NET
Does MS Office Live allows user to upload and use asp.net websites? We have
I have created a Asp.net MVC application. Now required 404 handling. Have updated global.asax
I have an existing ASP.NET web application that I'm converting to MVC 1.0. The
I am tasked with creating a dashboard interface in our ASP.NET MVC 3 web
We have to build an event registration website for our client in ASP.NET using
I've a requirement to be able to generate PDF's within our (ASP.net) application. We
I have an Asp.net MVC application which uses html5 and jquery on the client
I have a dynamic data ASP.NET application with a requirement to give some users

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.