/// <summary>
 /// Saves the webpart zone properties.
 /// </summary>
 protected void btnApply_Click(object sender, EventArgs e)
 {
     // Save webpart properties
     if (currentControl != null)
     {
         if (!isVariantTab)
         {
             CMSModules_PortalEngine_Controls_WebParts_WebPartZoneProperties webPartZonePropertiesElem = currentControl as CMSModules_PortalEngine_Controls_WebParts_WebPartZoneProperties;
             if (webPartZonePropertiesElem != null)
             {
                 webPartZonePropertiesElem.Save();
                 tabsElem.SelectedTab = 0;
             }
         }
         else
         {
             IWebPartZoneProperties webPartZoneVariantElem = currentControl as IWebPartZoneProperties;
             if (webPartZoneVariantElem != null)
             {
                 webPartZoneVariantElem.Save();
                 tabsElem.SelectedTab = 1;
             }
         }
     }
 }
    /// <summary>
    /// Saves the webpart zone properties and closes the window.
    /// </summary>
    protected void btnOK_Click(object sender, EventArgs e)
    {
        string script = string.Empty;
        bool   saved  = false;

        // Save webpart properties
        if (currentControl != null)
        {
            if (!isVariantTab)
            {
                CMSModules_PortalEngine_Controls_WebParts_WebPartZoneProperties webPartZonePropertiesElem = currentControl as CMSModules_PortalEngine_Controls_WebParts_WebPartZoneProperties;
                if ((webPartZonePropertiesElem != null) && webPartZonePropertiesElem.Save())
                {
                    saved = true;
                    if (this.chkRefresh.Checked)
                    {
                        if (webPartZonePropertiesElem.IsNewVariant && (webPartZonePropertiesElem.WebPartZoneInstance != null))
                        {
                            // Display the new variant by default
                            script = "UpdateVariantPosition('" + "Variant_Zone_" + webPartZonePropertiesElem.WebPartZoneInstance.ZoneID + "', -1); ";
                        }

                        script += "wopener.location.replace(wopener.location); ";
                    }
                }
            }
            else
            {
                IWebPartZoneProperties webPartZoneVariantElem = currentControl as IWebPartZoneProperties;
                if (webPartZoneVariantElem != null)
                {
                    saved = webPartZoneVariantElem.Save();
                    tabsElem.SelectedTab = 1;
                }
            }
        }

        // Close the window
        if (saved)
        {
            script         += "window.close();";
            ltlScript.Text += ScriptHelper.GetScript(script);
        }
    }
    /// <summary>
    /// Saves the webpart zone properties and closes the window.
    /// </summary>
    protected void btnOK_Click(object sender, EventArgs e)
    {
        string script = string.Empty;
        bool   saved  = false;

        // Save webpart properties
        if (currentControl != null)
        {
            if (!isVariantTab)
            {
                CMSModules_PortalEngine_Controls_WebParts_WebPartZoneProperties webPartZonePropertiesElem = currentControl as CMSModules_PortalEngine_Controls_WebParts_WebPartZoneProperties;
                if ((webPartZonePropertiesElem != null) && webPartZonePropertiesElem.Save())
                {
                    saved = true;
                    if (chkRefresh.Checked)
                    {
                        if ((variantId == 0) && (webPartZonePropertiesElem.WebPartZoneInstance != null))
                        {
                            // Display the new variant by default
                            script = "UpdateVariantPosition('Variant_Zone_" + webPartZonePropertiesElem.WebPartZoneInstance.ZoneID + "', -1); ";
                        }

                        script += "RefreshPage();";
                    }
                }
            }
            else
            {
                IWebPartZoneProperties webPartZoneVariantElem = currentControl as IWebPartZoneProperties;
                if (webPartZoneVariantElem != null)
                {
                    saved = webPartZoneVariantElem.Save();
                    tabsElem.SelectedTab = 1;
                }
            }
        }

        // Close the window
        if (saved)
        {
            script += "CloseDialog();";
            ScriptHelper.RegisterStartupScript(this, typeof(string), "closeZoneProperties", script, true);
        }
    }