Using Server.Transfer
to show a page that informs the user that the web site is at maintenance mode.
At global.asax:
void Application_BeginRequest(object sender, EventArgs e)
{
if (Request.IsLocal)
return;
if (ConfigurationManager.AppSettings["MaintenanceMode"] == "true")
{
if (Request.AcceptTypes != null && Request.AcceptTypes[0] == "text/html")
Server.Transfer("~/UserMessage.aspx?Maintenance");
}
}
Works well except when looking at the page source code I see that the CSS path has been updated but images' paths are not.
Any suggestions?