Esempio n. 1
0
        public static void RedirectTo(
            System.Web.HttpResponse InResponse,
            string InPageDirPath, string InPageName, RedirectParms InParms)
        {
            bool bArgs = false;

            // Build the full path name needed to redirect to this page relative to the
            // current page ( the from page )
            System.Text.StringBuilder url = new System.Text.StringBuilder(256);
            if (InPageDirPath != null)
            {
                url.Append(InPageDirPath + "/");
            }
            url.Append(InPageName);

            // add the querystring parms.
            if (InParms.IsNotEmpty)
            {
                if (bArgs == false)
                {
                    url.Append("?" + InParms.QueryString);
                }
                else
                {
                    url.Append("&" + InParms.QueryString);
                }
                bArgs = true;
            }

            // redirect to the page.
            InResponse.Redirect(url.ToString());
        }
Esempio n. 2
0
        // ------------------------- RedirectTo -------------------------------
        // Called by pages when redirecting to this page.
        // aspx pages should implement their own version when the page contains
        // QueryString parameters.  Otherwise, this base class can sparamete
        public static void RedirectTo(
            AcPage InFromPage, PageProperties InToPage, RedirectParms InParms)
        {
            bool   bArgs      = false;
            string subDir     = InFromPage.CalcRedirectDirPath(InToPage.PageDirPath);
            string passSessId = InFromPage.ComposePassSessId();

            // Build the full path name needed to redirect to this page relative to the
            // current page ( the from page )
            System.Text.StringBuilder url = new System.Text.StringBuilder(256);
            if (subDir != null)
            {
                url.Append(subDir + "/");
            }
            url.Append(InToPage.PageFileName);

            // add the SessId needed when a "no cookies browser"
            if (passSessId != null)
            {
                url.Append("?" + passSessId);
                bArgs = true;
            }

            // add the querystring parms.
            if (InParms.IsNotEmpty)
            {
                if (bArgs == false)
                {
                    url.Append("?" + InParms.QueryString);
                }
                else
                {
                    url.Append("&" + InParms.QueryString);
                }
                bArgs = true;
            }

            // redirect to the page.
            InFromPage.Response.Redirect(url.ToString());
        }