You need to look into a custom site map provider:
This will allow you to hide items as needed.
Unforunately, you'll have to loop on all items.
Or you can programmatically create the sitemap.
public class GranadaCoderSecureMapProvider : XmlSiteMapProvider
{
public GranadaCoderSecureMapProvider()
{
}
public override bool IsAccessibleToUser(HttpContext context, SiteMapNode
node)
{
//return base.IsAccessibleToUser(context, node);
string currentURL = node.Url;
if (currentURL.Length > 0)
{
//custom functionality here
// here is a simple substitution
return true;
}
return true;
}
}
And web.config section, dealing with this.
<system.web>
<siteMap defaultProvider="XmlSiteMapProvider">
<providers>
<add name="XmlSiteMapProvider" type="System.Web.XmlSiteMapProvider"
siteMapFile="~/Web.sitemap" securityTrimmingEnabled="true" />
<add name ="Company1SiteMap" type ="GranadaCoderSecureMapProvider"
siteMapFile="~/Sitemaps/confirmedUsers.sitemap"
securityTrimmingEnabled="true" />
</providers>
</siteMap>
"mike" <m_********@yahoo.com.au> wrote in message
news:11**********************@u72g2000cwu.googlegr oups.com...
I have 2 sites in my company. My .NET site uses a master page and a
Menu control connected to a sitemap. In my sitemap file I would like to
be able to do something like this:
<sitemap>
<sitemapnode site="City1">
<sitemapnode name="home" ... />
***other menu items here***
</sitemapnode>
<sitemapnode site="City2">
<sitemapnode name="home" ... />
***other menu items here***
</sitemapnode>
</sitemap>
When users in City1 or City2 request the home page, ASP.NET recognises
their location (by IP) and loads a location specific Master Page and
home page with a custom menu config. Some of the pages will be common
while others will be specific to the location. In this way, I would
only need to maintain one copy of common pages.
So is this possible without too much fiddling or should I just be
looking for other ways to do this?
Thanks
Mike