SenseNet.Portal.Page.RunPage C# (CSharp) Method

RunPage() static private method

static private RunPage ( HttpContext context, string path, Page pageNode, Exception &exception ) : void
context System.Web.HttpContext
path string
pageNode Page
exception System.Exception
return void
        internal static void RunPage(HttpContext context, string path, Page pageNode, out Exception exception)
        {
            PageBase page = null;
            string virtualPath = string.Empty;

            // prepare repository path
            try
            {
                virtualPath = CreateVirtualPath(path);
                page = InstantiatePage(context, virtualPath, pageNode);
                ExecutePage(context, virtualPath, page, pageNode, false);
                exception = null;
            }
            catch (Exception exc) //logged
            {
                Logger.WriteException(exc);
                exception = exc;
            }
        }

Usage Example

Example #1
0
        public static string[] RunPagesBackground(HttpContext context, out Exception[] exceptions)
        {
            var pages = GetAllPage();

            string[]         result        = new string[pages.Count];
            List <string>    pageList      = new List <string>();
            List <Exception> exceptionList = new List <Exception>();

            foreach (Node pageItem in pages.Nodes)
            {
                Exception exc = null;
                Page      p   = (Page)pageItem;
                if (p != null && p.HasTemporaryPortletInfo)
                {
                    Site site = p.Site;

                    if (site != null)
                    {
                        Page.RunPage(HttpContext.Current, p.Path, p, out exc);
                        pageList.Add(p.Path);

                        if (exc != null)
                        {
                            exceptionList.Add(exc);
                        }
                    }
                }
            }
            pageList.CopyTo(result, 0);
            exceptions = exceptionList.ToArray();
            return(result);
        }
All Usage Examples Of SenseNet.Portal.Page::RunPage