asp.net - Breadcrumbs SiteMapPath and SEO-Friendly Routing -


i have routing set follows:

void registerroutes(routecollection routes) {     routes.mappageroute("", "home", "~/default.aspx");     ...... } 

i'm implementing breadcrumbs using sitemappath control:

<asp:sitemappath id="sitemappath1" cssclass="breadcrumbs" runat="server"> </asp:sitemappath> 

web.sitemap set follows:

<?xml version="1.0" encoding="utf-8" ?> <sitemap xmlns="http://schemas.microsoft.com/aspnet/sitemap-file-1.0" >     <sitemapnode url="home" title="home"  description="home">             <sitemapnode url="~/about" title="about"  description="about">             <sitemapnode url="~/history" title="history"                   description="history" />             </sitemapnode>     </sitemapnode> </sitemap> 

my problem when navigate mysite.com instead of mysite.com/default.aspx, home breadcrumb node not appear. missing?

update

i managed "home" node display updating web.sitemap follows:

<?xml version="1.0" encoding="utf-8" ?> <sitemap xmlns="http://schemas.microsoft.com/aspnet/sitemap-file-1.0" >     <sitemapnode url="home" title="home"  description="home">         <sitemapnode url="~/default.aspx" title=""  description="" />         <sitemapnode url="~/about" title="about"  description="about">             <sitemapnode url="~/history" title="history"                   description="history" />         </sitemapnode>     </sitemapnode> </sitemap> 

the remaining problem path separator still displaying on home page mysite.com

is there way programatically render separator invisible home page? sitemappath control in master page.

enter image description here

maybe should change sitemap file follows :

<?xml version="1.0" encoding="utf-8" ?> <sitemap xmlns="http://schemas.microsoft.com/aspnet/sitemap-file-1.0" >     <sitemapnode url="~/" title="global site name or welcome message"  description="home">         <sitemapnode url="~/home" title="home"  description="" />         <sitemapnode url="~/about" title="about"  description="about">             <sitemapnode url="~/history" title="history"                   description="history" />         </sitemapnode>     </sitemapnode> </sitemap> 

and sitemapdatasource should set showstartingnode="false" , think solves both of problems @ once...

note: of course require made change in global.asax file (vb):

routetable.routes.mappageroute("home0", "", "~/default.aspx", true) routetable.routes.mappageroute("home1", "home", "~/default.aspx", true) 

hope helps...


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -