SiteMapProvider

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
 
S

Steve Harclerode

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>
 
S

Steve Harclerode

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
 

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

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top