title: Take an MVC web site offline and back online
body: <p>I'm searching for a method to take a website offline with a message. I know about app_offline.htm, but I would like to do it programmatically.</p>
  
  <p>Taking it offline is easy. I can generate app-offline.htm on root, but when I want web site to be back online it is not possible programmatically, because all services are down including images.</p>
  
  <p>My project uses MVC (C#). For now I'm storing the site status in an SQL server database in a bit field.</p>