Treeview and Sitemap issues

A

Amir Tohidi

Hi

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?

=====
SiteMap
=====
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<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" />
</siteMapNode>
</siteMapNode>
</siteMap>


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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Admin site</title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<h1>Admin</h1>
<div>
<span class="breadcrumb">
<asp:SiteMapPath ID="SiteMapPath1"
runat="server"></asp:SiteMapPath>
</span>
</div>
<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" />
</div>
<div>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>
 

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

Similar Threads

Treeview, event and databinding 2
How do I style the item in a asp:menu 0
Treeview bound to sitemap 1
sitemap 1
Need help with Menu control 0
2.0 Noob needs help with sitemap 1
Sitemap & roles 0
bug in .NET? 1

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top