Kentico CMS 6.0 Developer's Guide

Starting and stopping sites

Starting and stopping sites

Previous topic Next topic Mail us feedback on this topic!  

Starting and stopping sites

Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic!  

Arrow


API examples for newer versions


Please visit the latest API Examples documentation to view API examples for newer versions of Kentico.



The following example runs a site.

 

private bool RunSite()
{
    // Get the site
    SiteInfo site = SiteInfoProvider.GetSiteInfo("MyNewSite");
    if (site != null)
    {
        // Start site
        SiteInfoProvider.RunSite(site.SiteName);
 
        return true;
    }
 
    return false;
}

 

The following example stops a site.

 

private bool StopSite()
{
    // Get the site
    SiteInfo site = SiteInfoProvider.GetSiteInfo("MyNewSite");
    if (site != null)
    {
        // Stop site
        SiteInfoProvider.StopSite(site.SiteName);
 
        return true;
    }
 
    return false;
}