The <httpRuntime> section configures some run time
parameters for the ASP.NET pipeline. One attribute in the <httpRuntime>
element is enabled, which indicates whether the AppDomain is enabled to accept an
incoming request. The default value is "true," but we can override
the default value in Web.config. By setting this value to "false," the
application is not loaded in memory and any request entering the ASP.NET engine
for the application will return the default ASP.NET 404 error status page. It
should be noted that any requests not handled by the ASP.NET engine (images
files, CSS files, static HTML pages, and so on) will return the normal way.
Only ASP.NET resources will report a 404 status. To illustrate the same we can
set the value false for <httpRuntime> in order to make the application
offline. The following code snippet in applicaiton's Web.config is showing the
same.
Listing 1
<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
<httpRuntime enable="false" />
</system.web>
</configuration>
Once the abovementioned change has been made, users will get
the standard ASP.NET 404 error message for requesting any ASP.NET resource.
Figure 2