Click here to Skip to main content
Click here to Skip to main content

Tagged as

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 but 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 request coming to the ASP.NET site needs to stopped.
  • All request 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 the 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"
 

<OBJECT type="application/x-shockwave-flash" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=3,0,0,0" WIDTH="640" HEIGHT="360" data="http://www.youtube.com/v/N8vNYM7v5w0?version=3&feature=player_detailpage"></OBJECT>

License

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

Share

About the Author

Shivprasad koirala
Architect http://www.questpond.com
India India

I am a Microsoft MVP for ASP/ASP.NET and currently a CEO of a small
E-learning company in India. We are very much active in making training videos ,
writing books and corporate trainings. Do visit my site for 
.NET, C# , design pattern , WCF , Silverlight
, LINQ , ASP.NET , ADO.NET , Sharepoint , UML , SQL Server  training 
and Interview questions and answers


Comments and Discussions

 
SuggestionOne more thing to note Pinmemberhermiodinator18-Jun-12 10:37 
SuggestionBetter Method PinmemberBCantor14-Jun-12 13:29 
Questionnot reliable Pinmembergiammin9-Jun-12 1:36 
AnswerRe: not reliable PinmemberShivprasad koirala9-Jun-12 2:46 
GeneralRe: not reliable Pinmembergiammin9-Jun-12 6:08 
GeneralRe: not reliable PinmemberShivprasad koirala9-Jun-12 16:41 

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

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

| Advertise | Privacy | Mobile
Web02 | 2.8.140821.2 | Last Updated 9 Jun 2012
Article Copyright 2012 by Shivprasad koirala
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid