473,396 Members | 1,998 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

make web.sitemap location dependent

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

Mar 20 '06 #1
1 2026

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

Mar 20 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Joe | last post by:
I have a web.sitemap file that has the url title and description. I then have this attac attached to a menu. I want some of my menu choices to open up in a page in a new window ie _blank as...
2
by: mike | last post by:
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...
2
by: -D- | last post by:
I'm taking my first stab at using xml, so please bear with my novice questions and understanding of xml. I'm trying to create an xml file that holds all my website navigation. If I understand...
0
by: nick | last post by:
I have a sitemap <sitemap ...> <siteMapNode url="aaaa.aspx" title="aaaa" /> <siteMapNode url="http://bbbb.com" title="bbbb" /> </sitemap> The first one works well with form authorization....
3
by: Greg Collins [Microsoft MVP] | last post by:
Okay, this is driving me nuts now. I spent all last night researching newsgroup postings, web articles, etc. Running multiple sites off the same shared hosting service, I want to be able to...
4
by: shapper | last post by:
Hello, I am trying to convert an Asp.Net 2.0 XML sitemap file to a Google's sitemap file. I am posting the formats of both files. 1. How can I do the conversion? 2. And can I use an...
1
by: Alec MacLean | last post by:
Hi. I'm using VS2005 Pro to work on a website project for my company. The site has several navigation elements, all based on the standard VS2005 navigation components. I have high-level...
2
by: Steve B. | last post by:
Hi, I use a web.sitemap file to create a dynamic menu in my web application. I want to add an entry that does not navigate but add the page to the user's favorites. I added a node like this :...
0
by: Chris | last post by:
Hi, i have a problem with sitemap combined with roles. I already posted this but i reformulated simplier: here: there are two defined users: user1 and user2 there is one role: manager user1...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.