Click here to Skip to main content
12,399,799 members (51,077 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: ASP.NET
How can we temporary off the running website & gives a message "This site is Temprorary unavailable", actully i want to gives a power to admin he can temporary on/Off the website. Is this could be possible in asp.net.
according to my need i dnt want to add web_offline.htm page. I simply do it by button control i.e. Active website & Deactive website(dynamic method)..
Posted 12-Apr-12 18:14pm
Mas112.4K
Updated 12-Apr-12 21:29pm
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

You can have a page with the above message and direct all the pages load (or atleast the home) to this page till your maintenance done.
  Permalink  
Comments
Mas11 13-Apr-12 2:19am
   
dear lakamraju how can we load all pages with that error pages, can you explain briefly.. or write code if you can..
Mas11 13-Apr-12 2:34am
   
lakamraju please explain me how can i loaded all pages with that error pages.. I try so many method but till now i dont get a success.. I try over it from last two days.. please help me if you can..
Mas11 13-Apr-12 3:21am
   
Okk but according to my need i dnt want to add web_offline.htm page. I simply do it by button control i.e. Active website & Deactive website(dynamic method).
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

Create a simple htm file with name app_offline.htm and place it in the root of your website. This file will load automatically whenever any web page is requested from your site.

http://weblogs.asp.net/scottgu/archive/2005/10/06/426755.aspx[^]

You can manually remove/rename this file when you want to make your website accessible or write some code for the same.
  Permalink  
Comments
Mas11 13-Apr-12 2:55am
   
Okk but according to my need i dnt want to add web_offline.htm page. I simply do it by button control i.e. Active website & Deactive website(dynamic method).

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 13 Apr 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100