/// <summary>
            /// In layout pages, renders the content of a named section as items and specifies whether the section is required.
            /// </summary>
            /// <param name="page">Page instance</param>
            /// <param name="name">Section name to render as items</param>
            /// <param name="required">True to specify that the section is required</param>
            /// <returns></returns>
            public virtual TBuilder ItemsFromSection(System.Web.WebPages.WebPageBase page, string name, bool required)
            {
                BaseControl.SectionsStack.Push(new List <string>());
                var result = page.RenderSection(name, required);

                this.HandleResult(result);

                return(this as TBuilder);
            }
Example #2
0
            /// <summary>
            /// In layout pages, renders the content of a named section to content area of the widget
            /// </summary>
            /// <param name="page"></param>
            /// <param name="name"></param>
            /// <param name="required"></param>
            /// <returns></returns>
            public virtual TBuilder ContentFromSection(System.Web.WebPages.WebPageBase page, string name, bool required)
            {
                BaseControl.SectionsStack.Push(null);
                var result = page.RenderSection(name, required);

                if (result != null)
                {
                    this.ToComponent().ContentControls.Add(new LiteralControl(result.ToHtmlString()));
                }
                BaseControl.SectionsStack.Pop();
                return(this as TBuilder);
            }
Example #3
0
            /// <summary>
            /// In layout pages, renders the content of a named section as items and specifies whether the section is required.
            /// </summary>
            /// <param name="page">Page instance</param>
            /// <param name="name">Section name to render as items</param>
            /// <param name="required">True to specify that the section is required</param>
            /// <returns></returns>
            public virtual TBuilder ItemsFromSection(System.Web.WebPages.WebPageBase page, string name, bool required)
            {
                BaseControl.SectionsStack.Push(new List <string>());
                var result = page.RenderSection(name, required);

                if (result != null)
                {
                    this.ToComponent().ItemsToRender = result.ToHtmlString();
                    this.ToComponent().IDSToRender   = BaseControl.SectionsStack.Pop();
                }
                else
                {
                    BaseControl.SectionsStack.Pop();
                }

                return(this as TBuilder);
            }