DetectCurrentPageInfo() public static méthode

Detects the correct T:PageInfo object associated to the current page using the Page and NS parameters in the query string.
public static DetectCurrentPageInfo ( bool loadDefault ) : System.PageInfo
loadDefault bool true to load the default page of the specified namespace when Page is not specified, false otherwise.
Résultat System.PageInfo
Exemple #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // Try to detect current namespace and page
            currentNamespace = Tools.DetectCurrentNamespace();
            currentPage      = Tools.DetectCurrentPageInfo(true);

            lblStrings.Text = string.Format("<script type=\"text/javascript\">\r\n<!--\r\n__BaseName = \"{0}\";\r\n__ConfirmMessage = \"{1}\";\r\n// -->\r\n</script>",
                                            CphMaster.ClientID + "_", Properties.Messages.ConfirmOperation);

            PrintHtmlHead();
            PrintHeader();
            PrintSidebar();
            PrintFooter();
            PrintPageHeaderAndFooter();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            // Try to detect current namespace and page
            currentNamespace = Tools.DetectCurrentNamespace();
            currentPage      = Tools.DetectCurrentPageInfo(true);

            lblStrings.Text = string.Format("<script type=\"text/javascript\">\r\n<!--\r\n__BaseName = \"{0}\";\r\n__ConfirmMessage = \"{1}\";\r\n// -->\r\n</script>",
                                            CphMaster.ClientID + "_", Properties.Messages.ConfirmOperation);

            PrintHtmlHead();
            PrintHeader();
            PrintSidebar();
            PrintFooter();
            PrintPageHeaderAndFooter();

            // Sueetie Themes - Add Sueetie Themes
            Page.Header.Controls.Add(AddStyleSheet("shared.css"));
            Page.Header.Controls.Add(AddStyleSheet("wiki.css"));
            Page.Header.Controls.Add(AddStyleSheet("custom.css"));
            Page.Header.Controls.Add(new LiteralControl("<!--[if IE]>\n<link rel=\"stylesheet\" href=\"/themes/" + this.CurrentTheme + "/style/ie.css\" type=\"text/css\" />\n<![endif]-->\n"));
        }
Exemple #3
0
 /// <summary>
 /// Detects the correct <see cref="T:PageInfo" /> object associated to the current page using the <b>Page</b> and <b>NS</b> parameters in the query string.
 /// </summary>
 /// <param name="loadDefault"><c>true</c> to load the default page of the specified namespace when <b>Page</b> is not specified, <c>false</c> otherwise.</param>
 /// <returns>If <b>Page</b> is specified and exists, the correct <see cref="T:PageInfo" />, otherwise <c>null</c> if <b>loadDefault</b> is <c>false</c>,
 /// or the <see cref="T:PageInfo" /> object representing the default page of the specified namespace if <b>loadDefault</b> is <c>true</c>.</returns>
 protected PageInfo DetectPageInfo(bool loadDefault)
 {
     return(Tools.DetectCurrentPageInfo(loadDefault));
 }