Starting and stopping websites

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

The following sample code shows how you can start a website:

 

[C#]

 

using CMS.SiteProvider;

 

...

 

        // Get site object by code name

        SiteInfo si = SiteInfoProvider.GetSiteInfo("CorporateSiteASPX");

 

        // If site exists

        if (si != null)

        {

            // Run site

            SiteInfoProvider.RunSite(si.SiteName);

        }

 

The following sample code shows how you can stop a website:

 

[C#]

 

using CMS.SiteProvider;

 

...

 

        // Get site object by code name

        SiteInfo si = SiteInfoProvider.GetSiteInfo("CorporateSiteASPX");

 

        // If site exists

        if (si != null)

        {

            // Stop site

            SiteInfoProvider.StopSite(si.SiteName);

        }

 

Page url: http://devnet.kentico.com/docs/5_5r2/devguide/index.html?starting_and_stopping_websites.htm