Click here to Skip to main content
13,860,547 members
Click here to Skip to main content
Add your own
alternative version

Tagged as


10 bookmarked
Posted 8 Jun 2012
Licenced CPOL

Site is Under Maintenance, Please Visit Later: ASP.NET Trick

, 8 Jun 2012
Rate this:
Please Sign up or sign in to vote.
As a web site owner, we all boast about 24 x 7 uptime. But somewhere down below in our hearts, we know it’s difficult.

24 x 7 Uptime Guaranteed

As a web site owner, we all boast about 24 x 7 uptime. But somewhere down below in our hearts, we know it’s difficult. We need to bring down the website for maintenance, fixingdefects, upgrading, etc.

Easy Way…

As an innocent C# ASP.NET developer, you would think how about just stopping IIS web server, do your activity (maintenance, fixing defect, etc.) and then start the IIS again.

While this looks to be a but obvious way of solving the problem, it’s not the best way if we consider the end user perspective. The end user would see an ugly screen as shown below leading to more confusion.

Rather than end user seeing that kind of absurd screen, how about showing something more better and informative like: “Site is under maintenance and will be live till 3:00 AM”.

Going Offline Graciously:-App_Offline.htm

Also, I would like to highlight here, it’s not about showing the error message but technically we would like to ensure that the following things happen in IIS:-

  • Application domain under which the website is running is brought down.
  • All incoming requests coming to the ASP.NET site need to be stopped.
  • All requests to be routed to the temporary page which is created.
  • After maintenance, the application domain should be loaded and the incoming request should be processed in a normal manner.

Thanks to Microsoft, they always understand our needs. The proper way of approaching this problem is to create a simple “App_offline.htm” file in your application root directory. In this “App_offline.htm”, you can put your user friendly message which the end users can see when the site is under maintenance.

Once done, you can delete the file and your web site app domain is loaded and normal life continues.

You can visit my site for C# and .NET interview questions and in case you are a fresher, you can attend FREE C# training by clicking on C# training videos.

Take a quick look as revision for practical video on "Site is under maintenance"


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

You may also be interested in...


Comments and Discussions

SuggestionOne more thing to note Pin
hermiodinator18-Jun-12 11:37
memberhermiodinator18-Jun-12 11:37 
SuggestionBetter Method Pin
MacSpudster14-Jun-12 14:29
professionalMacSpudster14-Jun-12 14:29 
Questionnot reliable Pin
giammin9-Jun-12 2:36
membergiammin9-Jun-12 2:36 
AnswerRe: not reliable Pin
Shivprasad koirala9-Jun-12 3:46
memberShivprasad koirala9-Jun-12 3:46 
GeneralRe: not reliable Pin
giammin9-Jun-12 7:08
membergiammin9-Jun-12 7:08 
GeneralRe: not reliable Pin
Shivprasad koirala9-Jun-12 17:41
memberShivprasad koirala9-Jun-12 17:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web04 | 2.8.190214.1 | Last Updated 9 Jun 2012
Article Copyright 2012 by Shivprasad koirala
Everything else Copyright © CodeProject, 1999-2019
Layout: fixed | fluid