Ejemplo n.º 1
0
        ///
        /// <summary>
        /// Render this control to the writer parameter specified.
        /// </summary>
        /// <remarks>
        /// This is the method that actually outputs the HTML generated by the control into the page's
        /// HTML text stream.  You do not normally need to call this method directly.
        /// </remarks>
        /// <param name="writer">The <see cref="HtmlTextWriter"/> object that receives the server control content.</param>
        ///
        protected override void Render(HtmlTextWriter writer)
        {
            HtmlTextWriter realWriter = HtmlTextWriterFactory.CreateCorrectHtmlTextWriter(writer);

            PowerPack.Announce(realWriter, ProductName);

            if (Page != null)
            {
                Page.VerifyRenderingInServerForm(this);
            }

            bool uplevelBrowser = false;

            if (_realField is WysiwygRTField)
            {
                uplevelBrowser = true;
            }

            if (Page == null)
            {
                throw new ApplicationException("Page must not be null.");
            }

            if ((uplevelBrowser) && (Prompt != null) && (!Page.IsPostBack))
            {
                AddPromptAttributes();
            }

            _realField.Render(realWriter);

            return;
        }
Ejemplo n.º 2
0
        ///
        /// <summary>
        /// Render this control to the writer parameter specified.
        /// </summary>
        /// <remarks>
        /// Note for inheritors - for this control to function properly, any derived controls that override
        /// this method should ensure that they call this base method as part of their Render.
        /// </remarks>
        /// <param name="writer">The <see cref="HtmlTextWriter"/> object that receives the server control content.</param>
        ///
        protected override void Render(HtmlTextWriter writer)
        {
            HtmlTextWriter realWriter = HtmlTextWriterFactory.CreateCorrectHtmlTextWriter(writer);

            PowerPack.Announce(realWriter, ProductName);

            if (Page != null)
            {
                Page.VerifyRenderingInServerForm(this);
            }

            _realField.FinaliseAttributes();

            _realField.RenderBeforeControl(realWriter);

            base.RenderBeginTag(realWriter);
            foreach (ListItem liItem in Items)
            {
                string selected = liItem.Selected ? "selected=\"selected\" " : String.Empty;
                realWriter.Write("\t<option {2}value=\"{0}\">{1}</option>\n", HttpUtility.HtmlEncode(liItem.Value), liItem.Text, selected);
            }

            base.RenderEndTag(realWriter);
            if (!IsInDesignMode)
            {
                _realField.RenderMidText(realWriter);
                _realField.ApplyStyle(ControlStyle);
                _realField.RenderControl(realWriter);
                _realField.RenderAfterControl(realWriter);
            }

            return;
        }
Ejemplo n.º 3
0
        ///
        /// <summary>
        /// Raises the Render event and outputs the control to the page.
        /// </summary>
        /// <remarks>
        /// Note for inheritors - for this control to function properly, any derived controls that override
        /// this method should ensure that they call this base method as part of their Render.
        /// </remarks>
        /// <param name="writer">The <see cref="HtmlTextWriter"/> object that receives the server control content.</param>
        ///
        protected override void Render(HtmlTextWriter writer)
        {
            HtmlTextWriter realWriter = HtmlTextWriterFactory.CreateCorrectHtmlTextWriter(writer);

            PowerPack.Announce(realWriter, ProductName);

            if (Page != null)
            {
                Page.VerifyRenderingInServerForm(this);
            }

            RenderBeginTag(realWriter);
            if (IsIE() && EnableClientScript)
            {
                RenderContents_IE(writer);
            }
            else if (IsMozilla() && EnableClientScript)
            {
                RenderContents_Moz(writer);
            }
            else
            {
                if (IsExpanded())
                {
                    RenderContents_Default(writer);
                }
                else
                {
                    Visible = false;
                }
            }
            RenderEndTag(realWriter);

            return;
        }
Ejemplo n.º 4
0
        ///
        /// <summary>
        /// Render this control to the output parameter specified.
        /// </summary>
        /// <remarks>
        /// This is the method that actually outputs the HTML generated by the control into the page's
        /// HTML text stream.  You do not normally need to call this method directly.
        /// </remarks>
        /// <param name="writer">The <see cref="HtmlTextWriter"/> object that receives the server control content.</param>
        ///
        protected override void Render(HtmlTextWriter writer)
        {
            HtmlTextWriter realWriter = HtmlTextWriterFactory.CreateCorrectHtmlTextWriter(writer);

            PowerPack.Announce(realWriter, ProductName);

            return;
        }
Ejemplo n.º 5
0
        ///
        /// <summary>
        /// Raises the Render event and outputs the control to the page.
        /// </summary>
        /// <remarks>
        /// Note for inheritors - for this control to function properly, any derived controls that override
        /// this method should ensure that they call this base method as part of their Render.
        /// </remarks>
        /// <param name="writer">The <see cref="HtmlTextWriter"/> object that receives the server control content.</param>
        ///
        protected override void Render(HtmlTextWriter writer)
        {
            HtmlTextWriter realWriter = HtmlTextWriterFactory.CreateCorrectHtmlTextWriter(writer);

            _label.RenderControl(realWriter);
            realWriter.Write("<br />");

            base.Render(realWriter);

            return;
        }
Ejemplo n.º 6
0
        ///
        /// <summary>
        /// Render this control to the writer parameter specified.
        /// </summary>
        /// <remarks>
        /// Note for inheritors - for this control to function properly, any derived controls that override
        /// this method should ensure that they call this base method as part of their Render.
        /// </remarks>
        /// <param name="writer">The <see cref="HtmlTextWriter"/> object that receives the server control content.</param>
        ///
        override protected void Render(HtmlTextWriter writer)
        {
            HtmlTextWriter realWriter = HtmlTextWriterFactory.CreateCorrectHtmlTextWriter(writer);

            //
            // Don't announce this product because it may upset formatting.
            //
            //PowerPack.Announce (realWriter, ProductName);

            base.Render(realWriter);

            return;
        }
Ejemplo n.º 7
0
        ///
        /// <summary>
        /// Raises the Render event and outputs the control to the page.
        /// </summary>
        /// <remarks>
        /// Note for inheritors - for this control to function properly, any derived controls that override
        /// this method should ensure that they call this base method as part of their Render.
        /// </remarks>
        /// <param name="writer">The <see cref="HtmlTextWriter"/> object that receives the server control content.</param>
        ///
        protected override void Render(HtmlTextWriter writer)
        {
            HtmlTextWriter realWriter = HtmlTextWriterFactory.CreateCorrectHtmlTextWriter(writer);

            PowerPack.Announce(realWriter, ProductName);

            if (String.IsNullOrEmpty(ImageUrl))
            {
                ImageUrl = Page.ClientScript.GetWebResourceUrl(typeof(PopupImageButton), PopupConstants.IconResource);
            }

            base.Render(realWriter);

            return;
        }
        ///
        /// <summary>
        /// Raises the Render event and outputs the control to the page.
        /// </summary>
        /// <remarks>
        /// Note for inheritors - for this control to function properly, any derived controls that override
        /// this method should ensure that they call this base method as part of their Render.
        /// </remarks>
        /// <param name="writer">The <see cref="HtmlTextWriter"/> object that receives the server control content.</param>
        ///
        protected override void Render(HtmlTextWriter writer)
        {
            HtmlTextWriter realWriter = HtmlTextWriterFactory.CreateCorrectHtmlTextWriter(writer);

            PowerPack.Announce(realWriter, ProductName);

            if (Page != null)
            {
                Page.VerifyRenderingInServerForm(this);
            }

            base.Render(realWriter);

            return;
        }
Ejemplo n.º 9
0
        ///
        /// <summary>
        /// Raises the Render event and outputs the control to the page.
        /// </summary>
        /// <remarks>
        /// Note for inheritors - for this control to function properly, any derived controls that override
        /// this method should ensure that they call this base method as part of their Render.
        /// </remarks>
        /// <param name="writer">The <see cref="HtmlTextWriter"/> object that receives the server control content.</param>
        ///
        protected override void Render(HtmlTextWriter writer)
        {
            HtmlTextWriter realWriter = HtmlTextWriterFactory.CreateCorrectHtmlTextWriter(writer);

            PowerPack.Announce(realWriter, ProductName);

            if ((_uplevelBrowser) && (_prompt != null) && (_promptScriptOutput) && (!Page.IsPostBack))
            {
                AddPromptAttributes();
            }

            base.Render(realWriter);

            return;
        }
Ejemplo n.º 10
0
        ///
        /// <summary>
        /// Render this control to the writer parameter specified.
        /// </summary>
        /// <remarks>
        /// Note for inheritors - for this control to function properly, any derived controls that override
        /// this method should ensure that they call this base method as part of their Render.
        /// </remarks>
        /// <param name="writer">The <see cref="HtmlTextWriter"/> object that receives the server control content.</param>
        ///
        protected override void Render(HtmlTextWriter writer)
        {
            HtmlTextWriter realWriter = HtmlTextWriterFactory.CreateCorrectHtmlTextWriter(writer);

            PowerPack.Announce(realWriter, ProductName);

            string innerHtml = GetInnerHtml();

            _blockedWords = GetConfiguration(_configFile);

            string filteredInnerHtml = FilterHtml(innerHtml);

            realWriter.Write(filteredInnerHtml);

            return;
        }
Ejemplo n.º 11
0
        ///
        /// <summary>
        /// Raises the Render event and outputs the control to the page.
        /// </summary>
        /// <remarks>
        /// Note for inheritors - for this control to function properly, any derived controls that override
        /// this method should ensure that they call this base method as part of their Render.
        /// </remarks>
        /// <param name="writer">The <see cref="System.Web.UI.HtmlTextWriter"/> object that receives the server control content.</param>
        ///
        protected override void Render(HtmlTextWriter writer)
        {
            bool visible = false;

            if (Context.Request.IsAuthenticated)
            {
                string users = Users;
                if (!String.IsNullOrEmpty(users))
                {
                    string[] usersArray = users.Split(roleSeparators);
                    foreach (string user in usersArray)
                    {
                        if (Context.User.Identity.Name.Equals(user.Trim()))
                        {
                            visible = true;
                        }
                    }
                }

                string roles = Roles;
                if ((!visible) && !String.IsNullOrEmpty(roles))
                {
                    string[] rolesArray = roles.Split(roleSeparators);
                    foreach (string szRole in rolesArray)
                    {
                        if (Context.User.IsInRole(szRole.Trim()))
                        {
                            visible = true;
                        }
                    }
                }
            }

            if (visible)
            {
                HtmlTextWriter realWriter = HtmlTextWriterFactory.CreateCorrectHtmlTextWriter(writer);
                PowerPack.Announce(realWriter, ProductName);

                base.Render(realWriter);
            }

            return;
        }