473,796 Members | 2,601 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2051

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 programmaticall y create the sitemap.

public class GranadaCoderSec ureMapProvider : XmlSiteMapProvi der
{
public GranadaCoderSec ureMapProvider( )
{

}
public override bool IsAccessibleToU ser(HttpContext context, SiteMapNode
node)
{
//return base.IsAccessib leToUser(contex t, node);
string currentURL = node.Url;
if (currentURL.Len gth > 0)
{
//custom functionality here

// here is a simple substitution
return true;

}
return true;

}

}

And web.config section, dealing with this.

<system.web>
<siteMap defaultProvider ="XmlSiteMapPro vider">
<providers>
<add name="XmlSiteMa pProvider" type="System.We b.XmlSiteMapPro vider"
siteMapFile="~/Web.sitemap" securityTrimmin gEnabled="true" />
<add name ="Company1SiteM ap" type ="GranadaCoderS ecureMapProvide r"
siteMapFile="~/Sitemaps/confirmedUsers. sitemap"
securityTrimmin gEnabled="true" />
</providers>
</siteMap>
"mike" <m_********@yah oo.com.au> wrote in message
news:11******** **************@ u72g2000cwu.goo glegroups.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
6930
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 target. How do I do this with a web.sitemap file
2
1724
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 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...
2
2038
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 correctly, I can use xslt to create different menus from the xml file. What I'm trying to accomplish is to create a top menu bar, left navigation menu bar and sub header navigation bar. Then place the transformed xslt menus into user controls...
0
1024
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. But the second one never display. And I cannot add a location element in web.config since it must be a relative virtual path...
3
3558
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 redirect a non-existing siteinfo.xml and sitemap.xml to appropriate ASPX pages that will return valid XML for the domain accessed. I don't understand httpModules and httpHandlers very well but they don't seem to be what I need. There was discussion...
4
3291
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 .ashx Asp.Net file that when the .ashx file is
1
2482
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 section navigation provided via a horizontal menu, a SiteMapPath to provide a breadcrumb and a vertical menu component on the left edge.
2
2992
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 : <siteMapNode title="Ajouter cette page aux favoris" url="javascript:window.external.AddFavorite(location.href, document.title)"
0
1465
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 belongs to the role manager; user2 not. there are three pages (page1.aspx, page2.aspx and page3.aspx).
0
10459
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10237
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10187
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9055
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7553
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5446
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4120
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3735
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.