Click here to Skip to main content
15,906,463 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everyone,

I just wanted to ask if there is an elegant way to display a custom "Application offline" message while deploying an ASP.net website.

Problem is, that asp.net adds an app_offline.htm to the root to allow deploying and this app_offline.htm get's displayed. Now, I'd like to have an own file displayed automatically when deploying.

Any ideas?

Thanks and have nice weekend, Phil
Posted
Updated 17-Jun-10 23:24pm
v2

1 solution

Er, can't you just edit the app_offline file to suit? As long as the fie size is at least 512kb you can do what you want (below that size it may not display).

XML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>[TITLE]</title>
<style type="text/css">
* { color: white; font-family: tahoma; margin: 5px; }
</style>
</head>
<body bgcolor="323232">
<h2>Closed for essential maintenance.</h2>
<p>We'll be back up and running as soon as possible: sorry for any inconvenience.</p>
</body>
</html>
<!-- FILE MUST BE LARGER THAN 512kb. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut imperdiet ultrices diam, eu accumsan est scelerisque eleifend. Duis eu bibendum leo. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Phasellus at eros nec dolor tincidunt consectetur nec ac quam. Sed orci felis, sodales nec pulvinar at, cursus non magna. Praesent congue mi vitae nisl vehicula a eleifend nunc eleifend. Vestibulum urna ligula, tempus eu semper et, pretium in turpis. Duis sed lectus magna, sollicitudin pellentesque mauris. Pellentesque blandit risus ut velit ultricies a luctus elit iaculis. Vivamus posuere tortor et ligula aliquet et hendrerit elit semper. Duis facilisis nibh interdum magna viverra faucibus. Fusce eget fringilla lorem. Vestibulum aliquet dui justo. Praesent varius lorem nisl, in rhoncus odio. Praesent bibendum nibh at risus accumsan at ultricies dui varius. Fusce malesuada, mi vel convallis ultrices, tortor massa aliquam neque, in accumsan odio elit id nisl. -->
 
Share this answer
 
v2
Comments
Philip.F 18-Jun-10 9:18am    
Thanks for your answer. But afaik the app_offline.htm is automatically generated and cannot be changed.. Or am I wrong?
R. Giskard Reventlov 18-Jun-10 9:30am    
Yes, you are wrong. Create your own using the one generated as a template. I use a different version for every site.
Philip.F 18-Jun-10 9:34am    
Ok.. Do I just add an own app_offline.htm to the project to accomplish that?
R. Giskard Reventlov 18-Jun-10 9:46am    
Yes: I've added the content of one of mine to my answer.
Philip.F 18-Jun-10 9:49am    
Thank you very much for your kind help! Updated vote to 5 and accepted answer :-) Have a nice weekend!

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900