System.Web.WebPages.WebPageBase.ExecutePageHierarchy C# (CSharp) Method

ExecutePageHierarchy() private method

private ExecutePageHierarchy ( ) : void
return void
        public override void ExecutePageHierarchy()
        {
            // Unlike InitPages, for a WebPage there is no hierarchy - it is always
            // the last file to execute in the chain. There can still be layout pages
            // and partial pages, but they are never part of the hierarchy.

            // (add server header for falcon debugging)
            // call to MapPath() is expensive. If we are not emiting source files to header, 
            // don't bother to populate the SourceFiles collection. This saves perf significantly.
            if (WebPageHttpHandler.ShouldGenerateSourceHeader(Context))
            {
                try
                {
                    string vp = VirtualPath;
                    if (vp != null)
                    {
                        string path = Context.Request.MapPath(vp);
                        if (!path.IsEmpty())
                        {
                            PageContext.SourceFiles.Add(path);
                        }
                    }
                }
                catch
                {
                    // we really don't care if this ever fails, so we swallow all exceptions
                }
            }

            TemplateStack.Push(Context, this);
            try
            {
                // Execute the developer-written code of the WebPage
                Execute();
            }
            finally
            {
                TemplateStack.Pop(Context);
            }
        }

Same methods

WebPageBase::ExecutePageHierarchy ( System.Web.WebPages.WebPageContext pageContext, TextWriter writer ) : void
WebPageBase::ExecutePageHierarchy ( System.Web.WebPages.WebPageContext pageContext, TextWriter writer, System.Web.WebPages.WebPageRenderingBase startPage ) : void

Usage Example

Esempio n. 1
0
        private HelperResult RenderPageCore(string path, bool isLayoutPage, object[] data)
        {
            if (String.IsNullOrEmpty(path))
            {
                throw new ArgumentException(
                          CommonResources.Argument_Cannot_Be_Null_Or_Empty,
                          "path"
                          );
            }

            return(new HelperResult(
                       writer =>
            {
                path = NormalizePath(path);
                WebPageBase subPage = CreatePageFromVirtualPath(
                    path,
                    Context,
                    VirtualPathFactory.Exists,
                    DisplayModeProvider,
                    DisplayMode
                    );
                var pageContext = CreatePageContextFromParameters(isLayoutPage, data);

                subPage.ConfigurePage(this);
                subPage.ExecutePageHierarchy(pageContext, writer);
            }
                       ));
        }
All Usage Examples Of System.Web.WebPages.WebPageBase::ExecutePageHierarchy