473,385 Members | 2,004 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,385 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 2770
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.