By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,468 Members | 1,016 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,468 IT Pros & Developers. It's quick & easy.

Make sitemap dependent on master page

P: n/a
I'm using ASP.NET 2.0 and IIS 6

I've got a business with 2 sites requiring separate intranet info.
Currently, I have 2 separate intranet sites set up in IIS. This leads
to having to double up on shared pages which I'd rather not have. Both
sites use a master page and a Menu control bound to a SiteMap.

When a user loads the intranet home page, I want the appropriate Master
Page to load. As both sites are on different subnets, I can detect the
site through Request.UserHostAddress and deliver the appropriate Master
Page.

My question is whether I can maintain 2 separate SiteMap files in the
one web site and associate one with each Master Page or will ASP.NET
crack it?

Mar 29 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
You canot do this using the SiteMapDataSource control because you cannot
specify which XML file it uses for it's data, it has to use web.sitemap.
However the menu control can use any XML data source, not just the
SiteMapDataSource control, so you could for example use a different
XMLDataSource control in each master page and point that at whatever Site Map
XML file you want. I have even seen an SQL based site map datasource control
that someone created.

"mike" wrote:
I'm using ASP.NET 2.0 and IIS 6

I've got a business with 2 sites requiring separate intranet info.
Currently, I have 2 separate intranet sites set up in IIS. This leads
to having to double up on shared pages which I'd rather not have. Both
sites use a master page and a Menu control bound to a SiteMap.

When a user loads the intranet home page, I want the appropriate Master
Page to load. As both sites are on different subnets, I can detect the
site through Request.UserHostAddress and deliver the appropriate Master
Page.

My question is whether I can maintain 2 separate SiteMap files in the
one web site and associate one with each Master Page or will ASP.NET
crack it?

Mar 29 '06 #2

P: n/a
Yeah, I saw something a little while ago about a SQL based sitemap.
This might be a viable solution. I asked a question a little while ago
about selecting to display only parts of the sitemap but it sounded
like I'd have to create a custom class to handle it. My thought was to
configure the sitemap file something like this:

<sitemap>
<site1>
<sitemapnode />
....
</site1>
<site2>
<sitemapnode />
...
</site2>
</sitemap>

I think MS are on a good thing with this stuff but SiteMaps don't
support multiple site intranets. Maybe in the next version of ASP.NET...

Mar 31 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.