/// <summary>
    /// Handles OnAfterSave event of the UI Form.
    /// </summary>
    /// <param name="sender">Sender object</param>
    /// <param name="e">Event argument</param>
    protected void Control_OnAfterSave(object sender, EventArgs e)
    {
        string newSiteCodeName = ValidationHelper.GetString(Control.GetFieldValue("SiteName"), String.Empty);

        if (newSiteCodeName.ToLowerCSafe() != siteInfo.SiteName.ToLowerCSafe())
        {
            // Clear settings if sitename changes
            SettingsKeyInfoProvider.ClearCachedValues(true);

            // Reindex hashtable with sessions if SiteName changes and change info message
            SessionManager.ReindexSessionsInfosHashtable(formerCodeName, siteInfo.SiteName);
            if (SearchIndexInfoProvider.SearchEnabled)
            {
                Control.ShowInformation(String.Format(ResHelper.GetString("general.changessaved") + " " + ResHelper.GetString("srch.indexrequiresrebuild"), "<a href=\"javascript:" + ControlsHelper.GetPostBackEventReference(Control.ObjectManager.HeaderActions, "RebuildSiteIndex;") + "\">" + ResHelper.GetString("General.clickhere") + "</a>"));
            }
        }

        // Remove cached cultures for site
        CultureSiteInfoProvider.ClearSiteCultures(true);

        // Run the site if it was running previously
        try
        {
            if (runSite)
            {
                DataSet ds = SiteInfoProvider.CheckDomainNameForCollision(siteInfo.DomainName, siteInfo.SiteID);
                if (!DataHelper.DataSourceIsEmpty(ds))
                {
                    SiteInfo runningSiteInfo = SiteInfoProvider.GetSiteInfo(ValidationHelper.GetInteger(ds.Tables[0].Rows[0]["SiteID"], 0));
                    if (runningSiteInfo != null)
                    {
                        string collisionSite   = HTMLHelper.HTMLEncode(runningSiteInfo.DisplayName);
                        string collisionDomain = HTMLHelper.HTMLEncode(ValidationHelper.GetString(ds.Tables[0].Rows[0]["SiteDomainAliasName"], ""));

                        Control.ShowWarning(String.Format(ResHelper.GetString("SiteDomain.RunError"), collisionSite, collisionDomain, HTMLHelper.HTMLEncode(siteInfo.DisplayName)));
                    }
                }
                else
                {
                    // Run current site
                    SiteInfoProvider.RunSite(siteInfo.SiteName);
                }
            }
        }
        catch (RunningSiteException ex)
        {
            Control.ShowError(ex.Message);
        }
    }