title: How to set up a breadcrumb in an ASP.net page
body: <p>My folder hierarchy for the pages are (They are all in the same folder):</p>
  
  <pre><code>Site.Master
  Default.aspx
  find_provider.aspx
  provider.aspx
  </code></pre>
  
  <p>I have a <code>Web.sitemap</code> page set up:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" &gt;
      &lt;siteMapNode url="~/Default.aspx" title="Home"  description="Homepage"&gt;
          &lt;siteMapNode url="~/find_provider.aspx" title="Provider" description="Search for provider"&gt;
              &lt;siteMapNode url="~/provider.aspx" title="Profile" description="Shows each provider profile" /&gt;
          &lt;/siteMapNode&gt;
      &lt;/siteMapNode&gt;
  &lt;/siteMap&gt;
  </code></pre>
  
  <p>I am calling in my MasterPage:</p>
  
  <pre><code>&lt;div id="navigation"&gt;
      &lt;ul&gt;
          &lt;li&gt;&lt;asp:HyperLink runat="server" ID="lnkHome" NavigateUrl="~/Default.aspx"&gt;Home&lt;/asp:HyperLink&gt;&lt;/li&gt;
  
          &lt;asp:Repeater runat="server" ID="menu" DataSourceID="SiteMapDataSource1"&gt;
              &lt;ItemTemplate&gt;
                  &lt;li&gt;
                      &lt;asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='&lt;%# Eval("Url") %&gt;'&gt;&lt;%# Eval("Title") %&gt;&lt;/asp:HyperLink&gt;
                  &lt;/li&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:Repeater&gt;
      &lt;/ul&gt;
  
      &lt;asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" ShowStartingNode="false" /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>So <code>Default.aspx</code> is my landing page. User can click on <code>find_provider.aspx</code> to search for a provider of their choice. For each provider search result, the user can click on PROFILE link to view information for each individual provider, which is the <code>provider.aspx</code> page.</p>
  
  <p>So:</p>
  
  <ul>
  <li>If I am on the home page my breadcrumb should be: <code>Home</code></li>
  <li>If I am on the find a provider page my breadcrumb should be: <code>Home
  Provider</code></li>
  <li>If I am on the profile page my breadcrumb should be: <code>Home Provider
  Profile</code></li>
  </ul>
  
  <p>Instead, I see this on my page (no matter what page I am in):</p>
  
  <p>Please help me modify the code so that breadcrumb is shown for each sitenode and subsitenode.</p>
  
  <p>Sample of what I want to achieve:</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div class="bcHolder brClear"&gt; &lt;!-- BC MAIN --&gt;
      &lt;div class="innerBreadCrumb"&gt; &lt;!-- INNER BC --&gt;
          &lt;ul id="breadcrumb"&gt;
              &lt;li&gt;&lt;a href="default.aspx" title="Home"&gt;&lt;img src="theImages/homeIcon.gif" alt="Home" title="Home" class="home" /&gt;&lt;/a&gt;&lt;/li&gt;
              &lt;li id="bc_fp"&gt;&lt;a href="find_provider.aspx" title="Find a Provider"&gt;Find a Provider&lt;/a&gt;&lt;/li&gt;
              &lt;!--&lt;li&gt;{ON THE CURRENT PAGE TEXT/URL&lt;/li&gt;--&gt;
          &lt;/ul&gt;
      &lt;/div&gt; &lt;!-- INNER BC --&gt;
  &lt;/div&gt; &lt;!-- BC MAIN --&gt;
  </code></pre>
  
  <p>Output:</p>
  
  <p><img src="https://i.stack.imgur.com/O9Qhv.png" alt="enter image description here"></p>