Override menu/sitemapdatasource creation

alp0001

Freshman
Joined
Jul 2, 2003
Messages
28
Location
Near Chicago, IL. USA
Greetings,

I'm starting to play around in asp.net once again using the Personal Web Site Starter Kit. In the Default.master page, I have a menu control being created using a datasourceid property set to a sitemapdatasource control:
Visual Basic:
                <asp:menu id="menub" runat="server" 
                    datasourceid="SiteMapDataSource1" 
                    cssclass="menub"
                    orientation="Horizontal" 
                    maximumdynamicdisplaylevels="0" 
                    skiplinktext="" 
                    staticdisplaylevels="2" />
<asp:sitemapdatasource id="SiteMapDataSource1" runat="server" startingnodeoffset="0" />
I'm also using a SiteMapPath control in the same master page:
Visual Basic:
<asp:SiteMapPath id="SiteMapPath1" runat="Server" PathSeparator=" > " RenderCurrentNodeAsLink="false" />
What I would like to do is somehow override the menu/sitemapdatasource controls so that it skips one of the entries in the web.sitemap file. However, I would like to leave the entry in the web.sitemap file for the SiteMapPath control to show the value. Any idea where to begin? :confused:
 
What reason are you looking at skipping over the entry? Is this security related? If so then siteMaps have built in support for removing entries that are not accessibly for a given user anyway.
 
No, not security related. I just don't want the link (maybe others in the future) to be included in the menu creation. If I were to include the link in the web.sitemap file, the page would look like the following:
Code:
top menu:  link1 link2 link3 OnlyShowCurLocationlink

Current location: Homelink > OnlyShowCurLocationlink

bottom menu: link1 link2 link3 OnlyShowCurLocationlink
However, I want it to look like this:
Code:
top menu:  link1 link2 link3

Current location: Homelink > OnlyShowCurLocationlink

bottom menu: link1 link2 link3
If I can't override the creation, is it possible to have two web.sitemap files (one for the SiteMapPath control and one for the menu control)? I would prefer not having to do this, as I would need to maintain two files...
 
As a temporary workaround, I'm going to leave the link out of the web.sitemap file and create an absoultely positioned DIV with the hard-coded path for the page in question. Maybe when I become more proficent in .net capabilities, I can see how to overcome this .net control problem. I'm rather suprised that no one here knows of a way...
 
Back
Top