SiteMapProvider

  • Thread starter Thread starter Steve Harclerode
  • Start date Start date
S

Steve Harclerode

I'm working on my first SiteMapProvider. I just implemented a
SiteMapProvider sample, as shown on this page:
http://msdn.microsoft.com/en-us/library/ms178434(VS.80).aspx. I set up my
Access database just like in the sample.

I then added a SiteMapDataSource, and a TreeView on my Default.aspx page.
Here's the ASP.Net code for those:

<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />
<asp:TreeView ID="TreeView1" runat="server"
DataSourceID="SiteMapDataSource1" ExpandDepth="2">
</asp:TreeView>

What I see when I run this is just the root node. What do I need to do in
order to see the other levels? I ran the debugger to verify that the Site
Map is being created correctly inside of the AccessSiteMapProvider class
(which I copied from the URL above).

Thanks,
Steve
 
It's working all right now. Here's what the TreeView looks like at this
point:
<asp:TreeView ID="TreeView1" runat="server"
DataSourceID="SiteMapDataSource1" ExpandDepth="2"
AutoGenerateDataBindings="False">
<DataBindings>
<asp:TreeNodeBinding DataMember="SiteMapNode"
TextField="Title"
ToolTipField="Description" NavigateUrlField="Url" />
</DataBindings>
</asp:TreeView>
 
I still have one question open -- is there a way to get the TreeView to
show me only the current node and child nodes of the current node?

Right now it shows me the entire navigation heirarchy, starting with the
root node from the SiteMapProvider, no matter which page in the heirarchy
I'm currently on.

Thanks,
Steve
 
Back
Top