Don’t Mess with App_Offline

Resolved-error
Resolved-error @Image courtesy of Stuart Miles/ FreeDigitalPhotos.net

Don’t Mess with App_Offline

Welcome to CodeSpread!

One of the most useful features of ASP.NET is the “App_Offline.htm” . It provides a much easy way to make the ASP.NET application offline while we do our modifications on the site.

How we do it?

We just create a file and name it exactly  as ‘app_offline’ and place it in the root of a web application directory that we have configured within IIS., This will make the site offline, unload the application domain from the server, and stop processing any new incoming requests for that application.It will serve the contents of the app_offline.htm file in response to all new dynamic requests for the application.

How we make the site online?

Once we rename/remove the App_offline.htm file, the next request into the application will cause ASP.NET to load the application and app-domain again, and it will be back to normal.

This feature is first introduced in ASP.NET 2.0 and it is available now in all the later versions.

Sample app_offline.htm


<html>

<head>

<title>Application is not available</title>

</head>

<body>

This application is temporarily not available. Please try again later

</body>

</html>

This post is specially for Gaurav Raj. Please share your feedback.

Author: hershey

A passion for knowledge drives me to do programming, A passion for programming drives me to create something different, A passion for creation drives me to spread the knowledge.

Share This Post On

0 Comments

  1. nice superb explaination

    Post a Reply
  2. thanks for the tutorial
    I am having a problem.
    The feature “Create SQL server database” isn’t available , I can’t select it.
    Can you help, please ?

    Post a Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

More from CodeSpread:

  • Asp.Net: Hidden Truth of CookiesAsp.Net: Hidden Truth of CookiesI know there are several articles on cookies as what are they? and how can they be created? but i always wanted to know more about them. My questions were where they are stored? how to track their ...
  • C#: Useful JSON in .NetC#: Useful JSON in .NetWhy JSON? All web applications revolve around large chunk of data and availability of that data to our application is of utmost importance. To do that, we have options like fetch data from databas...
  • Asp.Net: More about CookiesAsp.Net: More about CookiesWe have seen, how our cookies looks in our last article Cookies Part 1. In this article, we will talk about their properties,limitations and technical part. Properties and Limitations Cook...
  • Note: GZipStreamNote: GZipStreamA short note from my experience: From the name itself you can at least make a guess about the functionality of the GZipStream class(present under: System.IO.Compression). Yes..your guess is abso...
  • ASP.NET : Stick to the ContextASP.NET : Stick to the ContextWhat we are talking about? We are talking about HttpContext Class. It is a part of System.Web namespace/assembly and is usually referred by, [code] System.Object System.Web.HttpContext [...
  • C# Code to send a MailC# Code to send a MailWhile working in a project, we always neglect the importance of the code which we have written many times and now end up in copy pasting the code from old projects. Lately, I saw a request in fo...
  • How to create a MVC 2 Project in VS2010?How to create a MVC 2 Project in VS2010?How to create a MVC 2 Project in VS2010? 1. Open VS2010. 2. Select File -> New Project. 3. Select Visual C# -> Web -> ASP.NET MVC 2 Empty Web Application. Name it as MyMvcApplicat...
  • Web-Page responses by PostBack, AutoPostBack, CrossPostBack, CallBack.Web-Page responses by PostBack, AutoPostBack, CrossPostBack, CallBack.It is difficult to find a site on the internet which does not respond to user's action. By user's action, i mean to say, clicking on a button, selecting something from a list, navigation links. The...