0
我有這樣配置的站點地圖:配置ASP.NET站點地圖網址域名
<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"/>
我有一個自定義麪包屑功能,看起來像這樣:
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
出於某種原因,甚至儘管在網站地圖中,網址被定義爲「www.website.com/index.aspx」或「home.aspx」,但currentNode.URL總是將該網址附加到該網址,從而創建諸如「www.domain」等不良網址。 com/www.website.com/index.aspx「
我試圖找出哪裏www.domain.com來自搜索我的項目和我的web.config文件內,但我似乎無法找到它。
任何想法或建議嗎?