Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8198249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:54:43+00:00 2026-06-07T05:54:43+00:00

I have a website with Page A and Page B Page B has a

  • 0

I have a website with Page A and Page B

Page B has a Link on Page A

Page B is actually a sub-sub-sub-web of Page C.

Now I am trying to make changes to Breadcrumb Navigation which is a custom User Control.

ATM I am trying to check if user is navigated to Page B from Page A then create this navigation and If Navigated from somewhere otherwise build a different Navigation. By using this property I know where a user coming from

Request.UrlReferrer.ToString()

OK Now problem is I want to build or get Site Map of Page/web a User is navigated from so that I can add this page B title to that Breadcrumb navigation as shown below,

Page A > Page B

or it can be

Page C > Page C.1 > Page C.2 > Page B

code I am using is this,

        string defaultBreadcrumbHtml = "<SPAN><a class=\"ms-sitemapdirectional\" href=\"{0}\">{1}</a></SPAN>";
    string defaultSpacingHtml = "<SPAN> > </SPAN>";


    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            SiteMapProvider contentMapProvider = SiteMap.Providers["SPContentMapProvider"];
            StringBuilder generatedHTML = new StringBuilder();
            generatedHTML.Append("<div class=\"ms-globallinks TopBreadcrumbs\">");


            if (contentMapProvider != null)
            {
                SiteMapNode currentNode = contentMapProvider.FindSiteMapNode(Request.UrlReferrer.ToString());

                if (currentNode != null)
                {

                    string[] breadcrumbTitles = new string[20]; ;
                    string[] breadcrumbUrls = new string[20];
                    int count = 0;

                    if (currentNode == contentMapProvider.RootNode)
                    {
                        breadcrumbTitles[0] = currentNode.Title;
                        breadcrumbUrls[0] = currentNode.Url;
                    }
                    else
                    {
                        while (currentNode != contentMapProvider.RootNode)
                        {
                            if (Request.UrlReferrer.ToString().Contains("PageA"))
                            {
                                breadcrumbTitles[count] = "Page B";
                                breadcrumbUrls[count] = string.Format("www.Gohome.com\PageB.aspx");
                                count++;
                            }

                            breadcrumbTitles[count] = currentNode.Title;
                            breadcrumbUrls[count] = currentNode.Url;

                            if (currentNode.ParentNode != null)
                            {
                                currentNode = currentNode.ParentNode;
                                count++;
                            }
                            else
                            {
                                break;
                            }

                        }

                        breadcrumbTitles[count] = currentNode.Title;
                        breadcrumbUrls[count] = currentNode.Url;
                    }

                    while (count >= 0)
                    {
                        generatedHTML.Append(string.Format(defaultBreadcrumbHtml, breadcrumbUrls[count], breadcrumbTitles[count]));
                        if (count != 0)
                        {
                            generatedHTML.Append(defaultSpacingHtml);
                        }
                        count--;
                    }

                    generatedHTML.Append("</div>");

                    html.Text = generatedHTML.ToString();
                }
            }

But its not working properly, I tried to debug it but because I am not able to get Site Map of Web/page I came from, I am not able to get site map.
So My question is, How can I get Site Map of Website I am navigated from , so that I add another Node to it as “siteicame from > ..> Page B”

to get Site Map of current page i can use this but I dont want to use this as It will give SiteMap as Site C > Site C.1 … > Site B

Cheers

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T05:54:45+00:00Added an answer on June 7, 2026 at 5:54 am

    To achieve Breadcrumb navigation … No need of code behind.

    You can achieve through

    1) Web.SiteMap
    2) ASPX Page’s Tabs

    If you want… i will show you sample code… ?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a website which has a web page containing list of logs. Now
I have an ASP.Net website which has a remember me feature for Login page.
I have a website which has 2 pages , (home_page.php and action_page.php)Action page takes
My page is a single page website which has a pageslide navigation on the
I have a website that has products list page and product detail page .
I have an ASP.NET Web Forms web site. It has a page inside of
i have website of application which sells applications online.on the home page i want
I have a single page website that changes content based on variables passed through
so I have a page that has a fixed link bar on the side.
Thank you in advance for any help. I have a website which has OpenGraph

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.