When I want to upgrade my database, I need to bring down the main site so that users don't affect the database while it's schema and data are being updated.
I was wondering how others have been able to put up a "maintenance page" that says something like "This site is currently undergoing maintenance. Please check back shortly."
Currently, I have created a configuration setting in web.config, and every time my main default.aspx loads, it checks to see if MaintenanceMode=true. If yes, it redirects to the maintenance page. This allows me to log into my server, change the web.config
file, and now the whole site redirects to the maintenance page.
The only problem I see with this, is that accessing web.config for every page load might be inefficient. However, a roundtrip to the database to check a setting like this seems even more inefficient.
Matt in Camb...
Member
39 Points
24 Posts
How to put your site into "maintenance mode"
Feb 13, 2012 02:03 PM|LINK
Hi,
When I want to upgrade my database, I need to bring down the main site so that users don't affect the database while it's schema and data are being updated.
I was wondering how others have been able to put up a "maintenance page" that says something like "This site is currently undergoing maintenance. Please check back shortly."
Currently, I have created a configuration setting in web.config, and every time my main default.aspx loads, it checks to see if MaintenanceMode=true. If yes, it redirects to the maintenance page. This allows me to log into my server, change the web.config file, and now the whole site redirects to the maintenance page.
The only problem I see with this, is that accessing web.config for every page load might be inefficient. However, a roundtrip to the database to check a setting like this seems even more inefficient.
Does anyone have any good ideas about this?
Thanks!
Matt
hans_v
All-Star
35986 Points
6550 Posts
Re: How to put your site into "maintenance mode"
Feb 13, 2012 02:07 PM|LINK
http://weblogs.asp.net/scottgu/archive/2005/10/06/426755.aspx
Matt in Camb...
Member
39 Points
24 Posts
Re: How to put your site into "maintenance mode"
Feb 13, 2012 03:27 PM|LINK
Perfect, thanks! I knew Microsoft had to have thought of this.