Having difficulty with tree view...

Occasional Contributor

Hello and thanks in advance. I have a relatively simple site using master pages to control content and on one of the nested master pages there is a tree view navigation component. Everything works fine except for the fact that when I preview the site, and click on the tree view it doesn't hold a parent/child relationship when navigated to. The tree view disappears and it leaves me with a link of the web page it is currently navigated to...


Take the code from the nested master shown below with the tree view... When previewing the page it ends up removing the parent-child relationship leaving no binding pages in the tree view and only presenting the current page it navigated to.



<%@ Master Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="MainPages.master.cs" Inherits="MasterPage2" %>

<asp:Content ID="Content2" ContentPlaceHolderID="rootSideNavTree" Runat="Server">
    <div class="SideNav">
        <asp:TreeView ID="TreeView1" runat="server" DataSourceID="SiteMapDataSource1" ExpandDepth="3"></asp:TreeView>

        <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" StartFromCurrentNode="True"/>


<asp:Content ID="Content3" ContentPlaceHolderID="rootContent" Runat="Server">
    <asp:ContentPlaceHolder ID="Content" runat="server" />



For the preview site photos...


2021-11-30.png2021-11-30 (1).png


Thank you again in advance...



0 Replies