giovedì 1 novembre 2012

Create a maintenance page in .NET in the silliest way possible

It's one of the most obscure features in .NET, i don't know for what reason...but it's also one of the most convenient features ever seen in the history of features.

a maintenance page is a simple page of your website that you can use during an update.

when you put a website in "maintenance mode", all the requests to your web application are redirected to the "maintenance page". This is quite useful in order to avoid wild users to fuck up your preciuos web application during an update process.

How to do this with less effort possible? the good news is that you can do this JUST by creating a file called "app_offline.htm" and drop it inside the root of your web application.

ASP.NET will immediately understand and while a file with that name will be inside the root directory, every attempt to access on that web application will be redirected to the content of the "app_offline.htm" file.

Simple,stupid but really useful.

Nessun commento:

Posta un commento