private SiteMapNode SiteMapResolve(object sender, SiteMapResolveEventArgs e)
        {
            HttpContext context = e.Context;
              SiteMapProvider provider = e.Provider;

              if (context == null)
            return null;

              HttpRequest request = context.Request;
              string pageName = VirtualPathUtility.GetFileName(request.Path);

              if (string.Compare(pageName, DefaultPage, StringComparison.OrdinalIgnoreCase) == 0)
              {
            List<SiteMapResolveEventHandler> resolveMethods = new List<SiteMapResolveEventHandler>();

            resolveMethods.Add(delegate
            {
              return provider.FindSiteMapNode(RemoveDefault(context.Request.RawUrl));
            });

            resolveMethods.Add(delegate
            {
              int queryStartIndex = context.Request.RawUrl.IndexOf("?", StringComparison.Ordinal);
              if (queryStartIndex != -1)
            return provider.FindSiteMapNode(RemoveDefault(context.Request.RawUrl.Substring(0, queryStartIndex)));
              else
            return null;
            });

            resolveMethods.Add(delegate
            {
              Page page = context.CurrentHandler as Page;
              if (page != null)
              {
            string queryString = page.ClientQueryString;

            if (queryString.Length > 0)
              return provider.FindSiteMapNode(RemoveDefault(context.Request.Path + "?" + queryString));
              }
              return null;
            });

            resolveMethods.Add(delegate
            {
              return provider.FindSiteMapNode(RemoveDefault(context.Request.Path));
            });

            foreach (SiteMapResolveEventHandler method in resolveMethods)
            {
              SiteMapNode node = method(sender, e);

              if (node != null)
            return node;
            }
              }

              return null;
        }
Beispiel #2
0
        public SiteMapNode SiteMapResolve(object sender, SiteMapResolveEventArgs e)
        {
            if (SiteMap.CurrentNode != null)
            {
                SiteMapNode currentNode = SiteMap.CurrentNode.Clone(true);
                SiteMapNode tempNode = currentNode;

                tempNode.Title = _profileUser;
                return currentNode;
            }
            return null;
        }
Beispiel #3
0
        // returns custom breadcrumb chain for this page. 

        public override SiteMapNode SiteMapResolve(object sender, SiteMapResolveEventArgs e)
        {
            var home = new SiteMapNode(e.Provider, "Home", "~/", "home");
            var admin = new SiteMapNode(e.Provider, "Admin", "~/admin", "administration");
            var members = new SiteMapNode(e.Provider, "Members", "~/admin/members", "members");
            var member = new SiteMapNode(e.Provider, "Member", null, "member details");

            admin.ParentNode = home;
            members.ParentNode = admin;
            member.ParentNode = members;

            return member;
        }
Beispiel #4
0
        // returns custom breadcrumb chain for this page. 

        public override SiteMapNode SiteMapResolve(object sender, SiteMapResolveEventArgs e)
        {
            var home = new SiteMapNode(e.Provider, "Home", "~/", "home");
            var shopping = new SiteMapNode(e.Provider, "Shopping", "~/shop", "shopping");
            var products = new SiteMapNode(e.Provider, "Products", "~/shop/products", "product catalog");
            var product = new SiteMapNode(e.Provider, "Product", null, "product details");

            shopping.ParentNode = home;
            products.ParentNode = shopping;
            product.ParentNode = products;

            return product;
        }
        private SiteMapNode ExpandPaths(Object sender, SiteMapResolveEventArgs e)
        {
            if (SiteMap.CurrentNode == null) return null;

            var currentNode = SiteMap.CurrentNode.Clone(true);
            var tempNode = currentNode;

            if ((null != (tempNode = tempNode.ParentNode)))
            {
                tempNode.Url = string.Format("~/Issues/IssueList.aspx?pid={0}", ProjectId);
            }

            return currentNode;
        }
        private static SiteMapNode ExpandIssuePaths(Object sender, SiteMapResolveEventArgs e)
        {
            if (SiteMap.CurrentNode == null) return null;

            var currentNode = SiteMap.CurrentNode.Clone(true);
            var tempNode = currentNode;

            if ((null != (tempNode = tempNode.ParentNode)))
            {
                tempNode.Url = string.Empty;
            }

            return currentNode;
        }
Beispiel #7
0
        // returns custom breadcrumb chain for this page. 

        public override SiteMapNode SiteMapResolve(object sender, SiteMapResolveEventArgs e)
        {
            var home = new SiteMapNode(e.Provider, "Home", "~/", "home");
            var admin = new SiteMapNode(e.Provider, "Admin", "~/admin", "administration");
            var orders = new SiteMapNode(e.Provider, "Orders", "~/admin/members/orders", "orders");

            var memberId = Page.RouteData.Values["memberid"].ToString();
            var member = new SiteMapNode(e.Provider, "Member", "~/admin/members/" + memberId + "/orders", "member orders");
            var details = new SiteMapNode(e.Provider, "Details", null, "line items");

            admin.ParentNode = home;
            orders.ParentNode = admin;
            member.ParentNode = orders;
            details.ParentNode = member;

            return details;
        }
Beispiel #8
0
        /// <summary>
        /// 当访问CurrentNode属性时发生.
        /// </summary>
        /// <param name="sender">
        /// 事件源, SiteMapProvider类的实例.
        /// </param>
        /// <param name="e">
        /// 包含事件数据的SiteMapResolveEventArgs.
        /// </param>
        /// <returns>
        /// 表示SiteMapResolveEventHandler处理结果的SiteMapNode.
        /// </returns>
        SiteMapNode SiteMap_SiteMapResolve(object sender, SiteMapResolveEventArgs e)
        {
            // 一次请求只执行一次.
            SiteMap.SiteMapResolve -= new SiteMapResolveEventHandler(SiteMap_SiteMapResolve);

            if (SiteMap.CurrentNode != null)
            {
                // SiteMap.CurrentNode是只读的,因此我们必须复制一份进行操作.
                SiteMapNode currentNode = SiteMap.CurrentNode.Clone(true);

                currentNode.Title = Request.QueryString["name"];

                // 在breadcrumb中使用已被修改的项.
                return currentNode;
            }
            return null;
        }
Beispiel #9
0
        /// <summary>
        /// 当访问CurrentNode属性时发生.
        /// </summary>
        /// <param name="sender">
        /// 事件源, SiteMapProvider类的实例.
        /// </param>
        /// <param name="e">
        /// 包含事件数据的SiteMapResolveEventArgs.
        /// </param>
        /// <returns>
        /// 表示SiteMapResolveEventHandler处理结果的SiteMapNode.
        /// </returns>
        SiteMapNode SiteMap_SiteMapResolve(object sender, SiteMapResolveEventArgs e)
        {
            // 一次请求只执行一次.
            SiteMap.SiteMapResolve -= new SiteMapResolveEventHandler(SiteMap_SiteMapResolve);

            if (SiteMap.CurrentNode != null)
            {
                // SiteMap.CurrentNode是只读的,因此我们必须复制一份进行操作.
                SiteMapNode currentNode = SiteMap.CurrentNode.Clone(true);

                currentNode.Title = Request.QueryString["name"];
                currentNode.ParentNode.Title = Database.GetCategoryByItem(Request.QueryString["name"]);
                currentNode.ParentNode.Url = "/Category.aspx?name=" + Database.GetCategoryByItem(Request.QueryString["name"]);

                // 在breadcrumb中使用已被修改的项.
                return currentNode;
            }
            return null;
        }
Beispiel #10
0
	    private SiteMapNode ChangeProductMap(SiteMapResolveEventArgs e, SiteMapNode parent)
        {

            SiteMapNode currentProductNode = e.Provider.FindSiteMapNode("~/Sitemap-Products.aspx").Clone(true);
            try
            {
                SiteMapNode tempNode = currentProductNode;
                Product product = ProductManager.GetProductByID(ProductId);
                tempNode.Url = SEOHelper.GetProductURL(product.ProductID);
                tempNode.Description = product.Name;
                tempNode.Title = product.Name;
                tempNode.ParentNode = parent;
            }
            catch
            {
            }

            return currentProductNode;
        }
Beispiel #11
0
	    private SiteMapNode ChangeNewsMap(SiteMapResolveEventArgs siteMapResolveEventArgs)
	    {
            SiteMapNode currentNode = null;
            try
            {
                currentNode = siteMapResolveEventArgs.Provider.FindSiteMapNode("~/Sitemap-News.aspx").Clone(true);
                News news = NewsManager.GetNewsByID(NewsId);
                if (news != null)
                {
                    currentNode.Url = SEOHelper.GetNewsURL(news);
                    currentNode.Description = news.Title;
                    currentNode.Title = news.Title;
                }
            }
            catch
            {
            }

            return currentNode;
	    }
Beispiel #12
0
        public SiteMapNode SiteMapResolve(object sender,SiteMapResolveEventArgs e)
        {
            string category = "";
            string question = "";

            SiteMapNode currentNode = null;
            if (SiteMap.CurrentNode == null)
            {
                var routable = e.Context.CurrentHandler as IRoutablePage;

                if (routable != null)
                {
                    var rc = routable.Routing.RequestContext;
                    var route = rc.RouteData.Route;
                    var segments = route.GetVirtualPath(rc, null).VirtualPath.Split('/');
                    var path = "~/" + string.Join("/", segments.Take(segments.Length - rc.RouteData.Values.Count).ToArray());
                    category = segments[1];
                    question = segments[2];
                    var findSiteMapNodeFromKey = SiteMap.Provider.FindSiteMapNodeFromKey(@"~\question");
                    if (findSiteMapNodeFromKey != null)
                        currentNode = findSiteMapNodeFromKey.Clone(true);
                }
            }
            if (SiteMap.CurrentNode != null)
            {
                currentNode = SiteMap.CurrentNode.Clone(true);
                currentNode.Url = @"~\Faq";
            }

            SiteMapNode tempNode = currentNode;
            if(category != "")
                tempNode.Title = category + " : " + question.Replace("_"," ");

            //tempNode = tempNode.ParentNode;
            ////tempNode.Title = question;
            //tempNode.Url = tempNode.Url;

            return currentNode;
        }
Beispiel #13
0
        /// <summary>
        /// Handles the SiteMapResolve event of the SmartSiteMapProvider control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Web.SiteMapResolveEventArgs"/> instance containing the event data.</param>
        /// <returns></returns>
        SiteMapNode SmartSiteMapProvider_SiteMapResolve(object sender, SiteMapResolveEventArgs e)
        {
            if (SiteMap.CurrentNode == null)
                return null;

            SiteMapNode temp;
            temp = SiteMap.CurrentNode.Clone(true);
            Uri u = new Uri(e.Context.Request.Url.ToString());

            SiteMapNode tempNode = temp;
            while (tempNode != null)
            {
                string qs = GetReliance(tempNode, e.Context);
                if (qs != null)
                    if (tempNode != null)
                        tempNode.Url += qs;

                temp = tempNode.ParentNode;
            }

            return temp;
        }
Beispiel #14
0
        protected SiteMapNode ResolveSiteMapNode(HttpContext context)
        {
            SiteMapResolveEventHandler eh = events [siteMapResolveEvent] as SiteMapResolveEventHandler;

            if (eh != null)
            {
                lock (resolveLock) {
                    if (resolving)
                    {
                        return(null);
                    }
                    resolving = true;
                    SiteMapResolveEventArgs args = new SiteMapResolveEventArgs(context, this);
                    SiteMapNode             r    = eh(this, args);
                    resolving = false;
                    return(r);
                }
            }
            else
            {
                return(null);
            }
        }
Beispiel #15
0
        /// <summary>
        /// Preserve the QueryString of past Pages
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <returns></returns>
        private SiteMapNode FillPaths(Object sender, SiteMapResolveEventArgs e)
        {
            SiteMapNode currentNode = SiteMap.CurrentNode.Clone(true);
            SiteMapNode temptNode = currentNode;

            // Obtain the recent IDs.
            int ID = GetPreviousID();

            // The current node, and its parents, can be modified to include
            // dynamic querystring information relevant to the currently
            // executing request.
            if (ID != 0)
            {
                temptNode.Url = temptNode.Url + "?Id=" + ID.ToString();
            }

            if (((temptNode = temptNode.ParentNode) != null) && ( ID != 0 ))
            {
                temptNode.Url = temptNode.Url + "?Id=" + ID.ToString();
            }

            return currentNode;
        }
Beispiel #16
0
        public SiteMapNode SiteMapResolve(object sender, SiteMapResolveEventArgs e)
        {
            if (SiteMap.CurrentNode != null)
            {
                SiteMapNode currentNode = SiteMap.CurrentNode.Clone(true);

                currentNode.Title = webResources.lblSearch;
                var test = searchFor.Text.Trim();
                if (!String.IsNullOrEmpty(test))
                {
                    SiteMapNode tempNode = currentNode;

                    var smp = (SiteMapPath)Master.FindControl("SiteMap");
                    //set breadcrumb for search results posts
                    var url = String.Format("[url=\"/Search\"]{0}[/url]", String.Format(webResources.lblSearch));
                    tempNode.Title = string.Format("{0}{1}{2}", url, smp.PathSeparator, "Results ..");

                }

                return currentNode;
            }
            return null;
        }
        /// <summary>
        /// 当访问CurrentNode属性时发生.
        /// </summary>
        /// <param name="sender">
        /// 事件源, SiteMapProvider类的实例.
        /// </param>
        /// <param name="e">
        /// 包含事件数据的SiteMapResolveEventArgs.
        /// </param>
        /// <returns>
        /// 表示SiteMapResolveEventHandler处理结果的SiteMapNode.
        /// </returns>
        SiteMapNode SiteMap_SiteMapResolve(object sender, SiteMapResolveEventArgs e)
        {
            // 一次请求只执行一次.
            SiteMap.SiteMapResolve -= new SiteMapResolveEventHandler(SiteMap_SiteMapResolve);

            // 我们可以在此创建很多SiteMapNodes.
            SiteMapNode childNode = new SiteMapNode(SiteMap.Provider, "2");
            childNode.Url = "/child.aspx";
            childNode.Title = "子页面";

            childNode.ParentNode = new SiteMapNode(SiteMap.Provider, "1");
            childNode.ParentNode.Url = "/root.aspx";
            childNode.ParentNode.Title = "根页面";

            // 我们也可以关联动态节点到已有的站点地图.
            SiteMapNode nodeFromSiteMap = GetSiteMapNode("item");
            if (nodeFromSiteMap != null)
            {
                childNode.ParentNode.ParentNode = nodeFromSiteMap;
            }

            // 在breadcrumb中使用已被修改的项.
            return childNode;
        }
Beispiel #18
0
        private SiteMapNode ExpandCategoryPaths(Object sender, SiteMapResolveEventArgs e)
        {
            SiteMapNode currentNode = null;

            if(NewsId != 0)
            {
                currentNode = ChangeNewsMap(e);
            }
            else if (TopicId != 0)
            {
                currentNode = ChangeTopicMap(e);
            }
            else
            {
                if (CategoryId != 0)
                {
                    if (e.Provider.CurrentNode == null)
                    {
                        currentNode = e.Provider.FindSiteMapNode("~/Sitemap-Categories.aspx").Clone(true);
                    }
                    else
                    {
                        currentNode = e.Provider.CurrentNode.Clone(true);
                    }

                    ChangeCategoryMap(e, currentNode);
                }

                if (0 != ProductId)
                {
                    currentNode = ChangeProductMap(e, currentNode);
                }
            }

            return currentNode;
        }
		protected SiteMapNode ResolveSiteMapNode (HttpContext context)
		{
			SiteMapResolveEventArgs args = new SiteMapResolveEventArgs (context, this);
			if (SiteMapResolve != null) {
				lock (resolveLock) {
					if (resolving) return null;
					resolving = true;
					SiteMapNode r = SiteMapResolve (this, args);
					resolving = false;
					return r;
				}
			}
			else
				return null;
		}
		protected SiteMapNode ResolveSiteMapNode (HttpContext context)
		{
			SiteMapResolveEventHandler eh = events [siteMapResolveEvent] as SiteMapResolveEventHandler;

			if (eh != null) {
				lock (resolveLock) {
					if (resolving)
						return null;
					resolving = true;
					SiteMapResolveEventArgs args = new SiteMapResolveEventArgs (context, this);
					SiteMapNode r = eh (this, args);
					resolving = false;
					return r;
				}
			} else
				return null;
		}
Beispiel #21
0
 private SiteMapNode Provider_SiteMapResolve(object sender, SiteMapResolveEventArgs e)
 {
     if (e.Context.CurrentHandler is ISiteMapResolver)
         return ((ISiteMapResolver)e.Context.CurrentHandler).SiteMapResolve(sender, e);
     else
         return null;
 }
        SiteMapNode SiteMap_File(object sender, SiteMapResolveEventArgs e)
        {
            SiteMapNode currentNode = SiteMap.CurrentNode.Clone(true);
            if (currentNode.Url == "/")
            {
                return currentNode;
            }

            using (Support s = new Support())
            {
                var target = (from x in s.Files
                              where x.id == id
                              select x).FirstOrDefault();

                currentNode.ParentNode.Url = "/Detail/DetailAction2" + "?id=" + _action + "&case_id=" + _incident;
                //Response.Write(currentNode.ParentNode.Url);
                return currentNode;
            }
        }
        /// <summary>
        /// Expands the issue paths.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="System.Web.SiteMapResolveEventArgs"/> instance containing the event data.</param>
        /// <returns></returns>
        private SiteMapNode ExpandIssuePaths(Object sender, SiteMapResolveEventArgs e)
        {
            SiteMapNode currentNode = SiteMap.CurrentNode.Clone(true);
            SiteMapNode tempNode = currentNode;

            // The current node, and its parents, can be modified to include
            // dynamic query string information relevant to the currently
            // executing request.
            if (ProjectId != 0)
            {
                tempNode.Url = tempNode.Url + "?id=" + ProjectId.ToString();
            }

            if ((null != (tempNode = tempNode.ParentNode)))
            {
                tempNode.Url = string.Format("~/Queries/QueryList.aspx?pid={0}", ProjectId);
            }

            return currentNode;
        }
        /// <summary>
        /// Expands the issue paths.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="System.Web.SiteMapResolveEventArgs"/> instance containing the event data.</param>
        /// <returns></returns>
        private SiteMapNode ExpandIssuePaths(Object sender, SiteMapResolveEventArgs e)
        {
            SiteMapNode currentNode = SiteMap.CurrentNode.Clone(true);
            SiteMapNode tempNode = currentNode;

            // The current node, and its parents, can be modified to include
            // dynamic query string information relevant to the currently
            // executing request.
            if (IssueId != 0)
            {
                string title = (TitleTextBox.Text.Length >= 30) ? TitleTextBox.Text.Substring(0, 30) + " ..." : TitleTextBox.Text;
                tempNode.Title = string.Format("{0}: {1}", lblIssueNumber.Text, title);
                tempNode.Url = tempNode.Url + "?id=" + IssueId.ToString();
            }
            else
                tempNode.Title = "New Issue";

            if ((null != (tempNode = tempNode.ParentNode)))
            {
                tempNode.Url = string.Format("~/Issues/IssueList.aspx?pid={0}", ProjectId);
            }

            return currentNode;
        }
Beispiel #25
0
        public SiteMapNode SiteMapResolve(object sender, SiteMapResolveEventArgs e)
        {
            if (SiteMap.CurrentNode != null)
            {
                SiteMapNode currentNode = SiteMap.CurrentNode.Clone(true);
                SiteMapNode tempNode = currentNode;

                tempNode.Title = _currentForum.Subject.CleanForumCodeTags();
                if (_currentForum.ModerationLevel != (int)Enumerators.Moderation.UnModerated)
                {
                    tempNode.Title += String.Format(" ({0})", EnumHelper.GetDescription((Enumerators.Moderation)_currentForum.ModerationLevel));
                }
                if (_archiveView == 1)
                {
                    tempNode.Title += " (Archived)";
                }
                else if (_currentForum.Status == (int)Enumerators.PostStatus.Closed)
                {
                    tempNode.Title += webResources.ForumIsLocked;
                }

                return currentNode;
            }
            return null;
        }
        SiteMapNode SiteMap_SiteMapResolve(object sender, SiteMapResolveEventArgs e)
        {
            SiteMapNode currentNode = SiteMap.CurrentNode.Clone(true);
            if (currentNode.Url == "/")
            {
                return currentNode;
            }

            currentNode.ParentNode.Url += "?id=" + case_id;

            return currentNode;
        }
Beispiel #27
0
        public SiteMapNode SiteMapResolve(object sender, SiteMapResolveEventArgs e)
        {
            if (SiteMap.CurrentNode == null)
                return null;
            SiteMapNode currentNode = SiteMap.CurrentNode.Clone(true);

            SiteMapNode tempNode = currentNode;

            switch (_action)
            {
                case "topic":
                    tempNode.Title = Resources.webResources.lblNewTopic;
                    tempNode = tempNode.ParentNode;
                    if (ForumId != null)
                    {
                        tempNode.Title = _forum.Subject;
                        tempNode.Url = "~/Content/Forums/forum.aspx?FORUM=" + ForumId;
                    }
                    break;
                case "reply":
                case "quote":
                    TextInfo textInfo = CultureInfo.CurrentCulture.TextInfo;
                    tempNode.Title = HttpUtility.HtmlDecode(_thisTopic.Subject) + " (" + textInfo.ToTitleCase(_action) + ")";
                    tempNode = tempNode.ParentNode;
                    tempNode.Title = string.Format("{0}", _thisTopic.Forum.Subject);
                    tempNode.Url = "~/Content/Forums/topic.aspx?TOPIC=" + _thisTopic.Id;
                    break;
                case "edit":
                    switch (_type)
                    {
                        case "reply":
                            tempNode.Title = Resources.webResources.lblEditReply;
                            break;
                        case "topics":
                            tempNode.Title = Resources.webResources.lblEditTopic + " " + HttpUtility.HtmlDecode(_thisTopic.Subject);
                            break;
                    }
                    tempNode = tempNode.ParentNode;
                    tempNode.Title = string.Format("{0}", _thisTopic.Forum.Subject);
                    tempNode.Url = "~/Content/Forums/topic.aspx?TOPIC=" + _thisTopic.Id;
                    break;
            }
            //HttpUtility.HtmlDecode(_thisTopic.Subject)
            return currentNode;
        }
        /// <summary>
        /// Expands the issue paths.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="System.Web.SiteMapResolveEventArgs"/> instance containing the event data.</param>
        /// <returns></returns>
        private SiteMapNode ExpandIssuePaths(Object sender, SiteMapResolveEventArgs e)
        {
            if (SiteMap.CurrentNode == null) return null;

            var currentNode = SiteMap.CurrentNode.Clone(true);
            var tempNode = currentNode;

            // The current node, and its parents, can be modified to include
            // dynamic query string information relevant to the currently
            // executing request.
            tempNode.Title = GetGlobalResourceObject("SharedResources", "NewIssue").ToString();

            if ((null != (tempNode = tempNode.ParentNode)))
            {
                tempNode.Url = string.Format("~/Issues/IssueList.aspx?pid={0}", ProjectId);
            }

            return currentNode;
        }
Beispiel #29
0
        /// <summary>
        /// Expands the project paths.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="System.Web.SiteMapResolveEventArgs"/> instance containing the event data.</param>
        /// <returns></returns>
        private SiteMapNode ExpandProjectPaths(Object sender, SiteMapResolveEventArgs e)
        {
            var currentNode = SiteMap.CurrentNode.Clone(true);
            var tempNode = currentNode;

            // The current node, and its parents, can be modified to include
            // dynamic query string information relevant to the currently
            // executing request.
            if (ProjectId != 0)
            {
                tempNode.Url = tempNode.Url + "?pid=" + ProjectId.ToString();
            }

            if ((null != (tempNode = tempNode.ParentNode)) &&
                (ProjectId != 0))
            {
                tempNode.Url = tempNode.Url + "?pid=" + ProjectId.ToString();
            }

            return currentNode;
        }
Beispiel #30
0
        /// <summary>
        /// Handles the SiteMapResolve event of the SiteMap control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Web.SiteMapResolveEventArgs"/> instance containing the event data.</param>
        /// <returns></returns>
        private SiteMapNode SiteMap_SiteMapResolve(object sender, SiteMapResolveEventArgs e)
        {
            // When using Server.Transfer FilePath will contain the original page (the one that was transfered
            // from) while CurrentExecutionFilePath will contain the page that is being transfered to.
            if (e.Context.Request.CurrentExecutionFilePath != e.Context.Request.FilePath)
            {
                SiteMapNode node = SiteMap.Provider.FindSiteMapNode(e.Context.Request.AppRelativeCurrentExecutionFilePath + e.Context.Request.Url.Query);

                if (node == null)
                {
                    node = SiteMap.Provider.FindSiteMapNode(e.Context.Request.AppRelativeCurrentExecutionFilePath);
                }

                return node;
            }
            else
            {
                return SiteMap.CurrentNode;
            }
        }
Beispiel #31
0
        // the Sitemap resolve event is handed over to the current page being processed 

        private SiteMapNode SiteMapResolveHandler(object sender, SiteMapResolveEventArgs e)
        {
            var pageBase = e.Context.CurrentHandler as PageBase;
            if (pageBase != null)
                return pageBase.SiteMapResolve(sender, e);
            else
                return null;
        }