473,803 Members | 3,616 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dynamic SiteMapPath

I’m trying to create a dynamic asp.net 2.0 siteMapPath control (using VB.net).
Using the xml sitemap I’ve got these three pages:

productGroup.as px
productListing. aspx
productDetail.a spx

Each page receives a query string i.e. productGroup.as px?id=9

The page then renders with the appropriate details which have been accessed
from an SQL 2005 database.

The siteMapPath looks like this:

Home / Product Group / Product Listing / Product Detail

What I’d like to do is to dynamically change the SiteMapPath, depending on
the product selected. It should then look something like:

Home / Widgets / Large Widgets / Widget No16

I’ve read the following article:
http://msdn2.microsoft.com/en-us/library/ms178425.aspx which has given me
some ideas - but its raised far more questions!

My questions are:

1. How do I capture the query string i.e. the number ”9” of ?id=9 and pass
it into a
variable?
2. How can I programmaticall y change the siteMapPath name property to show
something more meaningful i.e. instead of ‘Product Group’ show ‘Widgets’?
3. How do you use the HttpContext object as referenced in the MSDN Article?

Hope someone out there can help

Thanks

Mar 15 '07 #1
2 4268
Question 1:

//C#
string varAsString = Request.QuerySt ring["id];
int ID;

if(varAsString != null)
{
ID = int.Parse(varAs String);
}

'VB.NET
Dim varAsString as String = Request.QuerySt ring("id")
Dim ID as Integer

If Not (varAsString Is Nothing) Then
ID = Int32.Parse(var AsString)
End If

Question 2:
-----------
Out of the box, the SiteMapPath works against .sitemap. You can customize
the way it works through a custom provider (and thereby use a database
instead, for example), but you cannot do allof the dynamic lookups you will
need on the default provider. Worst case is inheriting from SiteMapPath and
creating your own custom control.

Question 3:
------------
HttpContext.Cur rent to get the current context:
http://odetocode.com/Articles/112.aspx

You can then use the instance methods, as described in the MSDN
documentation. Not sure if I am answering the question, as I am not sure
precisely what you are doing with it (did not have time to read the URL you
posted, apologies), but it should point you in the correct direction.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** *************** ***************
Think outside the box!
*************** *************** ***************
"James Page" <Ja*******@disc ussions.microso ft.comwrote in message
news:D3******** *************** ***********@mic rosoft.com...
I’m trying to create a dynamic asp.net 2.0 siteMapPath control (using
VB.net).
Using the xml sitemap I’ve got these three pages:

productGroup.as px
productListing. aspx
productDetail.a spx

Each page receives a query string i.e. productGroup.as px?id=9

The page then renders with the appropriate details which have been
accessed
from an SQL 2005 database.

The siteMapPath looks like this:

Home / Product Group / Product Listing / Product Detail

What I’d like to do is to dynamically change the SiteMapPath, depending on
the product selected. It should then look something like:

Home / Widgets / Large Widgets / Widget No16

I’ve read the following article:
http://msdn2.microsoft.com/en-us/library/ms178425.aspx which has given me
some ideas - but its raised far more questions!

My questions are:

1. How do I capture the query string i.e. the number ”9” of ?id=9 and pass
it into a
variable?
2. How can I programmaticall y change the siteMapPath name property to show
something more meaningful i.e. instead of ‘Product Group’ show ‘Widgets’?
3. How do you use the HttpContext object as referenced in the MSDN
Article?

Hope someone out there can help

Thanks
Mar 15 '07 #2
Thanks for your reply I'll let you know how I get on

Mar 15 '07 #3

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

Similar topics

4
2613
by: Robert Camsky | last post by:
Hi, I've got web.sitemap file with few nodes and subnodes and SiteMapPath control. It works fine. But imagine, I'm worrking on an calender implemented this way: calendar.aspx -> showing upcomming events calendar.apsx?year=2005 showing calendar for year 2005 calendar.apsx?year=2005&month=1 showing january in 2005 calendar.aspx?year=2005&month=1&day=1 showing 1/1/2005
0
1216
by: Not Me | last post by:
Hi all, 2 questions :) I would like to access user.identity.name through a master page.. this doesn't seem to be possible, any ideas on getting around this? Also, when using a sitemappath, I would like to store the trail/parent page along with some querystring parameters of my choice. Having looked this up I'm working with code found here:
1
3108
by: Danial | last post by:
Hi, How can I bind sitemappath (breadcrumb control of asp.net) to a custom ..sitemap file? By defualt its looking for web.sitemap file and giving me not found exception. Thanks Danial
1
4531
by: Jules | last post by:
In a ASP.NET 2.0 project I'd like to set an image as path separator in the SiteMapPath. When I edit the PathSepartor template (for this SiteMapPath) and drag an image on it, it works fine for all pages in the root of the Web project. VS2005 creates the folling aspx: <asp:SiteMapPath ID="SiteMapPath" runat="server"> <PathSeparatorTemplate> <img src="Images/arrow-right.jpg" /> </PathSeparatorTemplate> </asp:SiteMapPath>
5
3222
by: Jon via DotNetMonster.com | last post by:
Hi all, I'm using the ASP.NET sitemappath control and the ASP.NET menu control This sitemappath control works and shows the path when the page doesn't have an anchor - for example: <siteMapNode title="annual report" description="Annual report" url="Pages/ir_annuals.aspx" /> but the sitemappath control doesn't show the path if the page has the url
3
4463
by: Uriah Piddle | last post by:
Hi Gang, I have a SiteMapPath, bound to a Site Map, that traces a hierarchy down to an 'Article' leaf node. But the Article page shows one of many individual articles depending on which article the user chooses in the Articles page. The way it is set up now, if the user selects a particular article in the 'Articles' page, the SiteMap looks like this: '. . . Articles Article'. Assuming the user choses a cookie baking article, I would like...
1
2483
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.
1
2390
by: =?Utf-8?B?bWljaGFlbHJp?= | last post by:
We are dynamically changing the title property of nodes in our sitemappath to reflect the names of products by handling the SiteMapResolve event. We have some unicode characters in our product names, stored in our db using escape characters like: "è" When we set the SiteMapNode.Title to that value it is escaped by the sitemappath to "è" which results in the ampsand and code being printed out vs the desired character of: è
0
1562
by: =?Utf-8?B?TWFoZXNoIE5pbWJhbGthcg==?= | last post by:
Hi All, I am using WCSF in my application. I have Menu control and SiteMapPath, which are consuming SiteMapDataSource source provided by WCSF. Now I have Report Details page that is not directly accessible to user. User must come to this page from other page. So I have not registered this page in RegisterSiteMapInformation function of module initializer so that it will not show in Menu.
0
9564
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10548
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...
1
10295
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
9125
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 projectplanning, coding, testing, and deploymentwithout 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...
0
5500
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...
0
5629
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4275
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
3798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2970
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.