473,659 Members | 2,646 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ignoring certain querystring parameters in a custom SiteMapProvider ?

Don
Hi all,

So i may have painted myself into a corner, am I screwed?

I'm developing a message board for a site I work on, fairly simple
hierarchy. Topics -> Threads -> Posts. As such, I've written a custom
site map provider for my breadcrumb control. Adding SiteMapNodes for my
ViewThreads.asp x (see all the threads in a topic) is simple...
topicNode = new SiteMapNode(thi s, topic.Name,

string.Format(" ~/ViewThreads.asp x?topicid={0}",

topic.TopicId),
topic.Name,
topic.Descripti on);

AddNode(topicNo de, _forumHome);
And everything works great, until I tried to set up custom paging via
url (to make the page more SEO/google spider friendly). The new paging
setup appends a &page=X to the page's url, thus confusing the
breadcrumb control what page we're on.

So my question, is there any way to tell my sitemapnodes to ignore the
"page" querystring parameter? Barring that, is there another way to do
seo friendly paging (w/o postbacks essentially)?

Thank you in advance.

Don

May 18 '06 #1
1 2789
Don
Ok, I was able to solve my own problem. For those interested, i was
able to override FindSiteMapNode (string rawUrl) and parse out the
unwanted querystring parameters.

public override SiteMapNode FindSiteMapNode (string rawUrl)
{
if (rawUrl.IndexOf ("page=") >= 0)
{
int start = rawUrl.IndexOf( "page=");
int end = rawUrl.IndexOf( "&", start) + 1;
if (end >= start) //wasnt the last parameter
rawUrl = rawUrl.Remove(s tart, end - start);
else //it was the last parameter
rawUrl = rawUrl.Remove(s tart);
}
return base.FindSiteMa pNode(rawUrl);
}

May 23 '06 #2

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

Similar topics

3
5614
by: Nobody | last post by:
Hi -- I'm developing an ASP.NET application in VS.NET and I want the startup page to read in some parameters from a querystring. But I can't figure out where to set the querystring. I thought it was in the Project Properties dialog under the Debugging tab. There's a dropdown box where you can set the start up page. But VS ignores the querystring I add to the page name in this combo box. I know this because the Request.QueryString...
0
1265
by: jonathan.eves | last post by:
Hi I am having a hard time with localization of the sitemap. I have created a custom SiteMapProvider which inherits from StaticSiteMapProvider. For which everything works fine. The next thing i did was to add a unique resource key to each the nodes and add these resource keys to my globalisation database. Running a SQL Trace shows that the call for the localized resource is never made. Here is the code that builds creates my nodes
0
1077
by: Thomas Bandt | last post by:
Hi, I wrote my own SiteMapProvider which fetches the data from a Sql Database (Navigation hierarchy). But this data (categories) could contain absolute external Urls (like http://google.com/) as well as duplicate Urls to the same local or external file. In both scenarios the runtime throws an exception. Is there a known workaround?
2
1923
by: dhurwitz | last post by:
Hi, I have written a custom SiteMapProvider to retrieve site map data from a SQL Server database table. It works fine when used as the data source for a Menu control, so I am confident that all the nodes are being correctly populated. However, when used with a TreeView control, only the first node displays. Any suggestions on why this might be the case? Thanks.
0
1414
by: ashish | last post by:
hello all, I am trying to create a custom site map provider and since my site map is very huge, I am loading the required nodes when the CurrentNode property is called.. I am wondering if this would be a performance bottleneck, since according to my understanding a single nstance of sitemapprovider is loaded for the app domain
3
8002
by: Adrian Sharp | last post by:
I've got a pretty basic sitemap setup, but am getting a runtime error: "The SiteMapProvider 'MySiteMap' cannot be found." This occurs only when I access my website under IIS 5.1. When I run my app under the debugger (localhost:1946) I have no problem. I thought of trying IIS6.0, but am running XP, so can't upgrade to 6.0. Any ideas? my web.config relevant lines <siteMap> <providers>
0
1395
by: shapper | last post by:
Hello, I need to create a custom SiteMapProvider. I searched in Google for examples but I am still completly lost. The custom SiteMapProvider I need to create is exactly the same as the Asp.Net SiteMapProvider: The only difference is: attribute Visible = "True".
0
2126
by: Alex Brown | last post by:
Is it a problem to attach Non-static site map providers under one that inherits from StaticSiteMapProvider ? We are implementing a custom site map provider for a website that is being converted to ASP.NET 2.0. The conversion is going well because some of the features, like Master Pages and Site Maps, of ASP.NET 2.0 allow us to migrate away from a "top frame" style of navigation to a standard dynamic cascading top menu with minimal...
3
5732
by: Anders | last post by:
Hello, i have created a custom sitemap datasource. The sitemap gets all pages from a collection from a CMS system (not directly from a database). I have declared my sitemap provider as default in web.config. In the pages I have a sitemap datasource and corresponding menus. Question: - Where is the data cached? - How can I release it from the cache and refresh the data?
0
8851
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
8751
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...
0
8629
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6181
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
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4176
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
4338
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1982
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1739
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.