In the real world, there may be downtime for a web site even
after web application has been deployed and is live on the Internet or intranet.
This is because most applications require some updating with the flow of time.
For example, there may be the possibility of error in an application in the form
of a bug; there may be an enhancement for new features or modification of
existing features, etc. After fixing those bugs and implementing the enhancements,
the updated code needs to be deployed to the production environment. This may
involve updating pages, configuration files, making database modifications,
image update, DLL update and so on.
When updating a web application that is currently in production,
it is best to take the application offline so that users can understand that
there is some work going on for the application. This can be done in a variety
of ways, from simply stopping the web server software to displaying a web page
that informs the user that the site is offline for maintenance. The bottom line
is not to show customer/user any error page, instead inform them with a proper
message so that they will not be frustrated even though the application is
offline. The sample code snippets have been written in C#.