More in this section

Forums / Developing with Sitefinity / setting up redirects if database down

setting up redirects if database down

2 posts, 0 answered
  1. Webteam
    Webteam avatar
    28 posts
    30 Nov 2009
    28 May 2010
    Link to this post
    I have setup a number of error pages within sitefinity which I map to in IIS.  However if the database is down obviously none of these pages are accessible,  I would like to add some code to redirect to a static page in the case of a database problem however am not sure the best place to check the connection or trap an error.  For example a DB connection problem does not seem to throw an error to Application_Error in Global.asax.  Any advice on the best way to go about this is appreciated.  Thanks.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    30 May 2010
    Link to this post
    Hi David Desjardins,

    You could try creating HttpModule which is triggered on each request and check the connectionString to your database by creating an instance of SqlConnection. If the connection fails, redirect to a custom page.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
2 posts, 0 answered