473,287 Members | 1,650 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,287 software developers and data experts.

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.aspx (see all the threads in a topic) is simple...
topicNode = new SiteMapNode(this, topic.Name,

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

topic.TopicId),
topic.Name,
topic.Description);

AddNode(topicNode, _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 2768
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(start, end - start);
else //it was the last parameter
rawUrl = rawUrl.Remove(start);
}
return base.FindSiteMapNode(rawUrl);
}

May 23 '06 #2

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

Similar topics

3
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...
0
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...
0
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/)...
2
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...
0
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...
3
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...
0
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...
0
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...
3
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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.