Treeview and Sitemap issues


Amir Tohidi


I have the following simple SiteMapDataSource and TreeView control on my
site's master page. The TreeView works fine on the default (home) page and
the pages immesdiately below it. However, as soon as I naviagte to one of the
lower level pages (eg. Accounts/CurrentAccount.aspx), the TreeView disappears.

Can anyone please tell me what I am doing wrong?

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="" >
<siteMapNode url="Default.aspx" title="Home page" description="Home page">
<siteMapNode url="Accounts/AccountsDefault.aspx" title="Accounts"
description="Accounts home page">
<siteMapNode url="Accounts/CurrentAccount.aspx" title="Current
Accounts" description="Current Accounts functionality" />
<siteMapNode url="Reports/CurrentAccount.aspx" title="Current Account
Report" description="Reports functionality" />

Master page
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs"
Inherits="Admin.Site" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

<html xmlns="" >
<head runat="server">
<title>Admin site</title>
<asp:ContentPlaceHolder ID="head" runat="server">
<form id="form1" runat="server">
<span class="breadcrumb">
<asp:SiteMapPath ID="SiteMapPath1"
<div id="navigation">
<asp:TreeView ID="TreeView1" runat="server"
DataSourceID="SiteMapDataSource1" ExpandDepth="0" ShowLines="True" />
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server"
ShowStartingNode="False" StartFromCurrentNode="True" />
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question