Question

Using a <asp:SiteMapPath> control with the Web.sitemap file below:

<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />
<asp:SiteMapPath ID="SiteMapPath1" runat="server"></asp:SiteMapPath>
<asp:Image ID="Image1" runat="server" ImageUrl="~/closed-sign.jpg" Height="300" Width="400" />

While running it's not showing me way it should show as in this example.

It's only showing the image, with no sitemap.

How can this be fixed?

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="Default.aspx" title="Home"  description="Home Page">
<siteMapNode url="StandardToolBox.aspx" title="Standard ToolBox Control"  description="Standard ToolBox Control">
  <siteMapNode url="BulletedList.aspx" title="BulltedList Example"  description="BulltedList Control Simple Example" />
  <siteMapNode url="CheckBox.aspx" title="CheckBox Example"  description="CheckBox Control Simple Example" />
  <siteMapNode url="CheckBoxList.aspx" title="CheckBoxList Example"  description="CheckBoxList Control Simple Example" />
  <siteMapNode url="Image.aspx" title="Image Control Example" description="Image Control Simple Example"/>
</siteMapNode>
<siteMapNode url="DataToolBox.aspx" title="Data ToolBox Control"  description="Data ToolBox Control">
  <siteMapNode url="SqlDataSource.aspx" title="SqlDataSource Example"  description="SqlDataSource Simple Example" />
  <siteMapNode url="XmlDataSource.aspx" title="XmlDataSource Example"  description="XmlDataSource Simple Example" />
</siteMapNode>

Was it helpful?

Solution

The code you're using works fine.

Likely the page you're looking at is NOT anywhere in the list on the site map.

Ensure you're running this sample on a page named like:

  • StandardToolBox.aspx
  • CheckBox.aspx
  • DataToolBox.aspx

This is a breadcrumb control. It will only show links back to its parents. It will not send links to siblings.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top