Example #1
0
            /// <summary>
            /// An HTML fragment, or a DomHelper specification to use as the layout element content (defaults to '')
            /// </summary>
            public virtual TBuilder Html(Func <object, object> html)
            {
                BaseControl.SectionsStack.Push(null);
                ResourceManager.ScriptOrderNextRange();
                var result = html(null);

                this.ToComponent().Html = result.ToString();
                ResourceManager.ScriptOrderPrevRange();
                BaseControl.SectionsStack.Pop();
                return(this as TBuilder);
            }
Example #2
0
            /// <summary>
            ///
            /// </summary>
            /// <param name="content"></param>
            /// <returns></returns>
            public virtual TBuilder Content(Func <object, object> content)
            {
                BaseControl.SectionsStack.Push(null);
                ResourceManager.ScriptOrderNextRange();
                var result = content(null);

                this.ToComponent().ContentControls.Add(new LiteralControl(result.ToString()));
                ResourceManager.ScriptOrderPrevRange();
                BaseControl.SectionsStack.Pop();
                return(this as TBuilder);
            }
            /// <summary>
            /// Renders the content of one page within another page to content area of the widget
            /// </summary>
            /// <param name="page"></param>
            /// <param name="path"></param>
            /// <param name="data"></param>
            /// <returns></returns>
            public virtual TBuilder ContentFromPage(System.Web.WebPages.WebPageBase page, string path, params object[] data)
            {
                BaseControl.SectionsStack.Push(null);
                ResourceManager.ScriptOrderNextRange();
                var result = page.RenderPage(path, data);

                if (result != null)
                {
                    this.ToComponent().ContentControls.Add(new LiteralControl(result.ToHtmlString()));
                }
                ResourceManager.ScriptOrderPrevRange();
                BaseControl.SectionsStack.Pop();
                return(this as TBuilder);
            }
            /// <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);
                ResourceManager.ScriptOrderNextRange();
                var result = page.RenderSection(name, required);

                if (result != null)
                {
                    this.ToComponent().ContentControls.Add(new LiteralControl(result.ToHtmlString()));
                }
                ResourceManager.ScriptOrderPrevRange();
                BaseControl.SectionsStack.Pop();
                return(this as TBuilder);
            }
            /// <summary>
            /// Render specified partial view as content
            /// </summary>
            /// <param name="partialViewName"></param>
            /// <returns></returns>
            public virtual TBuilder ContentFromPartial(string partialViewName, object model, ViewDataDictionary viewData)
            {
                BaseControl.SectionsStack.Push(null);
                ResourceManager.ScriptOrderNextRange();
                var result = Ext.Net.X.Builder.HtmlHelper.Partial(partialViewName, model, viewData);

                if (result != null)
                {
                    this.ToComponent().ContentControls.Add(new LiteralControl(result.ToHtmlString()));
                }
                ResourceManager.ScriptOrderPrevRange();
                BaseControl.SectionsStack.Pop();
                return(this as TBuilder);
            }
            /// <summary>
            /// Invokes the specified action methods and use the result as content
            /// </summary>
            /// <param name="actionName"></param>
            /// <param name="controllerName"></param>
            /// <param name="routeValues"></param>
            /// <returns></returns>
            public virtual TBuilder ContentFromAction(string actionName, string controllerName, System.Web.Routing.RouteValueDictionary routeValues)
            {
                BaseControl.SectionsStack.Push(null);
                ResourceManager.ScriptOrderNextRange();
                var result = Ext.Net.X.Builder.HtmlHelper.Action(actionName, controllerName, routeValues);

                if (result != null)
                {
                    this.ToComponent().ContentControls.Add(new LiteralControl(result.ToHtmlString()));
                }
                ResourceManager.ScriptOrderPrevRange();
                BaseControl.SectionsStack.Pop();
                return(this as TBuilder);
            }