Click here to Skip to main content
Rate this: bad
good
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.2K
Edited 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 at 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 at 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 at 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 at 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
0 CPallini 480
1 Sergey Alexandrovich Kryukov 335
2 OriginalGriff 285
3 George Jonsson 246
4 Gihan Liyanage 235
0 OriginalGriff 4,873
1 CPallini 3,900
2 Sergey Alexandrovich Kryukov 3,474
3 George Jonsson 2,646
4 Gihan Liyanage 2,236


Advertise | Privacy | Mobile
Web02 | 2.8.140905.1 | Last Updated 13 Apr 2012
Copyright © CodeProject, 1999-2014
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