/// <summary>
        /// defaults add sessionInfo = true
        /// </summary>
        /// <param name="sUrl"></param>
        /// <param name="addSelfToHistory"></param>
        public void NavigateTo(string sUrl, bool addSelfToHistory)
        {
            string returnId    = null;
            string navigateUrl = "";

            if (IsPageModal)
            {
                MCSUrl url = new MCSUrl(sUrl);
                url.SetParameter(QS_ISPAGEMODAL, "true");
                sUrl = url.ToString();
            }

            #region Add to History
            if (addSelfToHistory)
            {
                returnId = "" + AddUrlToHistory(PageUrl.ToString());
            }
            else
            {
                returnId = returnUrlId.ToString();
            }
            #endregion



            #region Build return URL
            MCSUrl newUrl = new MCSUrl(sUrl);
            newUrl.SetParameter(MCSUrl.ReturnUrl, returnId);
            navigateUrl = newUrl.ToString();
            #endregion

            navigateUrl = Utilities.BuildURL(navigateUrl);
            Response.Redirect(navigateUrl);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// The spider opens the web page and it extracts all the links
 /// </summary>
 private void FindUrls()
 {
     try
     {
         HtmlWeb      web      = new HtmlWeb();
         HtmlDocument document = web.Load(PageUrl.ToString());
         PageLinks = document.DocumentNode.SelectNodes("//a[@href]").Select(node => node.Attributes["href"].Value).ToList();
     }
     catch (Exception)
     {
         this.IsAlive = false;
     }
 }
Ejemplo n.º 3
0
 public void NavigateToCurrentPage()
 {
     if (Driver.Url != PageUrl.ToString())
     {
         if (WaitForPageToLoad)
         {
             Driver.NavigateToUrlAndWaitForPageToLoad(PageUrl);
         }
         else
         {
             Driver.NavigateToUrl(PageUrl);
         }
     }
 }
Ejemplo n.º 4
0
        protected Search.IndexItem GetBaseIndexItem()
        {
            var indexItem = new Search.IndexItem {
                Created      = CreatedDate,
                LanguageId   = LanguageId,
                Modified     = UpdateDate,
                PageId       = PageId,
                PublishStart = StartPublish,
                PublishStop  = StopPublish
            };

            if (PageUrl != null)
            {
                indexItem.Path = PageUrl.ToString();
            }

            return(indexItem);
        }
        private void processReturnURL()
        {
            string prevUrl = Request.QueryString[MCSUrl.ReturnUrl];

            if (prevUrl != null && prevUrl.Length > 0)
            {
                try
                {
                    long urlId = long.Parse(prevUrl);
                    try
                    {
                        prevUrl = GetUrlById(urlId);
                    }
                    catch (NoPageInHistoryException)
                    {
                        prevUrl = PageUrl.ToString();
                    }
                    returnUrlId = urlId;
                }
                catch (FormatException)
                {
                    // the parameter contains the full url.  store it in the url manager.
                    long urlId = AddUrlToHistory(HttpUtility.UrlDecode(prevUrl));
                    PageUrl.SetParameter(MCSUrl.ReturnUrl, urlId.ToString());
                    returnUrlId = urlId;
                }
            }
            else
            {
                MCSUrl eu = new MCSUrl("http://www.monet.k12.ca.us");
                prevUrl = eu.BuildURL();                 //TODO make a contstant
            }
            ClientScript.RegisterHiddenField("PreviousUrl", prevUrl);
            ClientScript.RegisterHiddenField("MyUrl", PageUrl.ToString());
            ClientScript.RegisterHiddenField("ServerUrl", Utilities.GetAppPathURL());
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Returns the page url.
 /// </summary>
 /// <returns></returns>
 public override string ToString() => PageUrl.ToString();