J'ai une carte de site configuré en tant que tel:Configuration ASP.NET Plan du site URL de domaine
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="www.website.com/index.aspx" title="Site Name" description="">
<siteMapNode url="home.aspx" title="My Home" description="My Home" Group="Active">
<siteMapNode url="Search.aspx" title="Search" description="Search For Roommate" Group="Active">
<siteMapNode url="SearchResults.aspx" title="Search Results" description="Roommate Search Results" Group="Active"/>
</siteMapNode>
<siteMapNode url="Extend.aspx" title="Extend Account" description="Extend Account" Group="Active"/>
<siteMapNode url="Hotlist.aspx" title="Hotlist" description="Hotlist" Group="Active"/>
J'ai une fonction breadcrumb personnalisé qui ressemble à ceci:
Public Shared Function SitePath(ByVal tr As String, Optional ByVal type As String = "REG") As String
If SiteMap.Providers(type).CurrentNode IsNot Nothing And SiteMap.Providers(type).CurrentNode IsNot SiteMap.Providers(type).RootNode Then
Dim currentNode As SiteMapNode
currentNode = SiteMap.Providers(type).CurrentNode
Dim path As String = currentNode.Title
Dim str As String = ""
Do
currentNode = currentNode.ParentNode
path = "<a href=""" & shsutils.generateURLSecure(currentNode.Url, tr & str) & """>" & currentNode.Title & "</a>" & " > " & path
Loop While currentNode IsNot SiteMap.Providers(type).RootNode
SitePath = path
Exit Function
End If
SitePath = ""
End Function
Pour une raison quelconque, même Bien que dans le sitemap, l'URL soit définie comme "www.website.com/index.aspx" ou "home.aspx", currentNode.URL a toujours le domaine attaché à l'URL, ce qui crée de mauvaises URL comme "www.domain". com/www.website.com/index.aspx "
J'ai essayé de comprendre d'où provenait www.domain.com en cherchant mon projet et à l'intérieur de mon fichier web.config, mais je n'arrive pas à le trouver.
Des idées ou des suggestions?