public override string ToHtmlString()
        {
            LoadData();

            StringBuilder sb = new StringBuilder();

            string sBody = String.Empty;

            ContentSnippet cs = null;

            try {
                bool bIsEditor = SecurityData.IsAdmin || SecurityData.IsSiteEditor;

                if (this.SnippetID != Guid.Empty)
                {
                    cs = ContentSnippet.GetSnippetByID(SiteData.CurrentSiteID, this.SnippetID, !bIsEditor);
                }
                else
                {
                    cs = ContentSnippet.GetSnippetBySlug(SiteData.CurrentSiteID, this.SnippetSlug, !bIsEditor);
                }

                string sBodyNote = String.Empty;
                string sIdent    = String.Empty;

                if (cs != null)
                {
                    if (bIsEditor && (cs.IsRetired || cs.IsUnReleased || !cs.ContentSnippetActive))
                    {
                        string sBodyFlags = String.Empty;
                        if (!cs.ContentSnippetActive)
                        {
                            sBodyFlags += CMSConfigHelper.InactivePagePrefix + " - Status : " + cs.ContentSnippetActive.ToString() + " ";
                        }
                        if (cs.IsRetired)
                        {
                            sBodyFlags += CMSConfigHelper.RetiredPagePrefix + " - Retired : " + cs.RetireDate.ToString() + " ";
                        }
                        if (cs.IsUnReleased)
                        {
                            sBodyFlags += CMSConfigHelper.UnreleasedPagePrefix + " - Unreleased : " + cs.GoLiveDate.ToString() + " ";
                        }

                        if (SecurityData.AdvancedEditMode)
                        {
                            sBodyNote = "<div class=\"cmsSnippetOuter\"> <div class=\"cmsSnippetInner\">\r\n" + cs.ContentSnippetSlug + ": " + sBodyFlags.Trim() + "\r\n<br style=\"clear: both;\" /></div></div>";
                        }
                        else
                        {
                            sBodyNote = "<div>\r\n" + cs.ContentSnippetSlug + ": " + sBodyFlags.Trim() + "\r\n<br style=\"clear: both;\" /></div>";
                        }
                    }

                    if (SecurityData.AdvancedEditMode)
                    {
                        sIdent = "<div class=\"cmsSnippetOuter\"> <div class=\"cmsSnippetInner\">\r\n" + cs.ContentSnippetSlug + ": " + cs.ContentSnippetName + "\r\n<br style=\"clear: both;\" /></div></div>";
                    }

                    sBody = String.Format("{0}\r\n{1}\r\n{2}", sIdent, cs.ContentBody, sBodyNote);
                }
            } catch {
                if (!SiteData.IsWebView)
                {
                    if (this.SnippetID != Guid.Empty)
                    {
                        sBody = this.SnippetID.ToString();
                    }
                    else
                    {
                        sBody = this.SnippetSlug;
                    }
                }
            }

            sBody = SiteData.CurrentSite.UpdateContentSnippet(sBody);

            sb.AppendLine();
            sb.Append(sBody);
            sb.AppendLine();

            return(sb.ToString());
        }
        protected override void RenderContents(HtmlTextWriter output)
        {
            string sBody = string.Empty;

            ContentSnippet cs = null;

            try {
                bool bIsEditor = SecurityData.IsAdmin || SecurityData.IsSiteEditor;

                if (this.SnippetID != Guid.Empty)
                {
                    cs = ContentSnippet.GetSnippetByID(SiteData.CurrentSiteID, this.SnippetID, !bIsEditor);
                }
                else
                {
                    cs = ContentSnippet.GetSnippetBySlug(SiteData.CurrentSiteID, this.SnippetSlug, !bIsEditor);
                }

                string sBodyNote = string.Empty;
                string sIdent    = String.Empty;

                if (cs != null)
                {
                    if (bIsEditor && (cs.IsRetired || cs.IsUnReleased || !cs.ContentSnippetActive))
                    {
                        string sBodyFlags = string.Empty;
                        if (!cs.ContentSnippetActive)
                        {
                            sBodyFlags += CMSConfigHelper.InactivePagePrefix + " - Status : " + cs.ContentSnippetActive.ToString() + " ";
                        }
                        if (cs.IsRetired)
                        {
                            sBodyFlags += CMSConfigHelper.RetiredPagePrefix + " - Retired : " + cs.RetireDate.ToString() + " ";
                        }
                        if (cs.IsUnReleased)
                        {
                            sBodyFlags += CMSConfigHelper.UnreleasedPagePrefix + " - Unreleased : " + cs.GoLiveDate.ToString() + " ";
                        }

                        if (SecurityData.AdvancedEditMode)
                        {
                            sBodyNote = "<div class=\"cmsSnippetOuter\"> <div class=\"cmsSnippetInner\">\r\n" + cs.ContentSnippetSlug + ": " + sBodyFlags.Trim() + "\r\n<br style=\"clear: both;\" /></div></div>";
                        }
                        else
                        {
                            sBodyNote = "<div>\r\n" + cs.ContentSnippetSlug + ": " + sBodyFlags.Trim() + "\r\n<br style=\"clear: both;\" /></div>";
                        }
                    }

                    if (SecurityData.AdvancedEditMode)
                    {
                        sIdent = "<div class=\"cmsSnippetOuter\"> <div class=\"cmsSnippetInner\">\r\n" + cs.ContentSnippetSlug + ": " + cs.ContentSnippetName + "\r\n<br style=\"clear: both;\" /></div></div>";
                    }

                    sBody = String.Format("{0}\r\n{1}\r\n{2}", sIdent, cs.ContentBody, sBodyNote);
                }
            } catch {
                if (!SiteData.IsWebView)
                {
                    if (this.SnippetID != Guid.Empty)
                    {
                        sBody = this.SnippetID.ToString();
                    }
                    else
                    {
                        sBody = this.SnippetSlug;
                    }
                }
            }

            this.Text = SiteData.CurrentSite.UpdateContentSnippet(sBody);

            int indent = output.Indent;

            output.Indent = indent + 3;
            output.WriteLine();

            output.WriteLine();
            output.Write(this.Text);
            output.WriteLine();

            output.Indent = indent;
        }