I am just starting to use the treeview and the sitemap together. This is a very simple sitemap and treeview.
the problem is that: according to the sitemap there is a root "home" and then there are 2 nodes "work Visa" and "skilled work visa". each of those nodes have subnodes or child nodes.
the tree view works fine in the fist level of nodes. But if I open 1 of the main nodes to expose the child nodes all is ok but if I click on a child node it navigates to that page just fine but the treeview coplapses itself and returns to the initial state where nothing is selected on it at all.
I hope I make myself clear. When you click on a main node (the 2 top ones below "home") it navigates to that page and that node changes its apearance to show that it is the selected node. If I click on the arrow next to the node then the node opens and exposes its child nodes.... but you go click on one of the child nodes it navigates to that page but the treeview retuirns to the initial not selected state all colapsed and all...
you can witness this at:
http://www.canadawelcome.ca/home.aspx?AspxAutoDetectCookieSupport=1
why?
<asp:SiteMapDataSource ID="SiteMapDataSource3" runat="server"
SiteMapProvider="TBH_SiteMapProvider" StartFromCurrentNode="False" />
<asp:TreeView SkinID="MainLeftTree" ID="TreeView1" cssclass="LeftTreeViewMenu" runat="server" ImageSet="Arrows" Style="vertical-align: top; background-color: #FFE4E1; color: darkred;
width: 100%; text-align: left; padding: 5px;" DataSourceID="SiteMapDataSource3" MaxDataBindDepth="20">
<ParentNodeStyle Font-Bold="False" />
<HoverNodeStyle Font-Underline="True" ForeColor="#5555DD" />
<SelectedNodeStyle Font-Underline="True" ForeColor="#5555DD"
HorizontalPadding="0px" VerticalPadding="0px" />
<NodeStyle Font-Names="Verdana" Font-Size="8pt" ForeColor="Black"
HorizontalPadding="5px" NodeSpacing="0px" VerticalPadding="0px" />
</asp:TreeView>
this is my site map:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" enableLocalization="true" >
<siteMapNode title="HOME" url="~/home.aspx">
<siteMapNode title="WORK VISA" url="~/WorkVisas/WorkVisas.aspx">
<siteMapNode title="JOB DESCRIPTION" url="~/WorkVisas/JobDescription.aspx" />
</siteMapNode>
<siteMapNode title="SKILLED WORK VISA" url="~/SkilledWorkVisas/SkileedWorkVisaGC.aspx">
<siteMapNode title="Who can apply" url="~/SkilledWorkVisas/WhoCanApplyGC.aspx" />
<siteMapNode title="How to apply" url="~/SkilledWorkVisas/HowToApplyGC.aspx" />
<siteMapNode title="Simplyfied application process" url="~/SkilledWorkVisas/SimplyfiedAppGC.aspx" />
</siteMapNode>
</siteMapNode>
</siteMap>