The content you're reading is getting on in years
This post is on the older side and its content may be out of date.
Be sure to visit our blogs homepage for our latest news, updates and information.
Until now, the message when the application pool is recycled was unextendable, but since our latest internal build (Sitefinity 7.1.5205), this could be easily achieved as our dev team exposed two methods in SitefinityHttpModule:
/// <summary>
/// Called on begin request during system restarting. The request should be completed here, because the system will not be able to handle the request at this time.
/// By default sends 'The system is restarting...' message and completes the request.
/// Can be overridden to implement different behavior.
/// </summary>
/// <param name="context">The HTTP context.</param>
protected
virtual
void
OnSystemRestarting(HttpContext context);
/// <summary>
/// Sends a response message to the clients with the specified body html and delayed redirect. Completes the request.
/// </summary>
/// <param name="context">The HTTP context.</param>
/// <param name="bodyHtml">The body HTML.</param>
/// <param name="timeout">The timeout in milliseconds before redirect. By default it is 3000.</param>
/// <param name="redirctUrl">The redirect URL. Optional, If it is not specified </param>
public
static
void
SendDelayedRedirect(HttpContext context,
string
bodyHtml,
int
timeout = 3000,
string
redirectUrl =
null
);
The steps necessary to change the message are as follows:
namespace
SitefinityWebApp.Tests
{
/// <summary>
/// Custom Sitefinity HTTP module - customize the default "The system is restarting..." message
/// </summary>
public
class
CustomSitefinityHttpModule : SitefinityHttpModule
{
/// <summary>
/// Called on begin request during system restarting. The request should be completed here, because the system will not be able to handle the request at this time.
/// By default sends 'The system is restarting...' message and completes the request.
/// Can be overridden to implement different behavior.
/// </summary>
/// <param name="context">The HTTP context.</param>
protected
override
void
OnSystemRestarting(HttpContext context)
{
SitefinityHttpModule.SendDelayedRedirect(context,
"<h2>Custom restarting message</h2><p>Please wait a few seconds. You will be redirected automatically.</p>"
);
}
}
}
<
system.webServer
>
<
modules
runAllManagedModulesForAllRequests
=
"true"
>
<
add
name
=
"Sitefinity"
type
=
"SitefinityWebApp.Tests.CustomSitefinityHttpModule, SitefinityWebApp"
/>
...
After recycling the application pool the change should take effect.
View all posts from Vassil Vassilev on the Progress blog. Connect with us about all things application development and deployment, data integration and digital business.
Let our experts teach you how to use Sitefinity's best-in-class features to deliver compelling digital experiences.
Learn MoreSubscribe to get all the news, info and tutorials you need to build better business apps and sites
Progress collects the Personal Information set out in our Privacy Policy and the Supplemental Privacy notice for residents of California and other US States and uses it for the purposes stated in that policy.
You can also ask us not to share your Personal Information to third parties here: Do Not Sell or Share My Info
We see that you have already chosen to receive marketing materials from us. If you wish to change this at any time you may do so by clicking here.
Thank you for your continued interest in Progress. Based on either your previous activity on our websites or our ongoing relationship, we will keep you updated on our products, solutions, services, company news and events. If you decide that you want to be removed from our mailing lists at any time, you can change your contact preferences by clicking here.