以下为引用的内容:
Const DEFAULT_UNNAMED_PAGE_TITLE As String = "Untitled Page" Const DEFAULT_PAGE_TITLE As String = "Welcome to my Website!!" 中国.站长站
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 'Set the page's title, if needed If String.IsNullOrEmpty(Page.Title) OrElse Page.Title = DEFAULT_UNNAMED_PAGE_TITLE Then If SiteMap.CurrentNode Is Nothing Then Page.Title = DEFAULT_PAGE_TITLE Else Page.Title = GetPageTitleBasedOnSiteNavigation()
中国站长.站
'Can also use the following if you'd rather 'Page.Title = GetPageTitleBasedOnSiteNavigationUsingRecursion(SiteMap.CurrentNode) End If End If End Sub
中.国站长站
Private Function GetPageTitleBasedOnSiteNavigation() As String If SiteMap.CurrentNode Is Nothing Then Throw New ArgumentException("currentNode cannot be Nothing") End If 中国站长.站
'We are visiting a page defined in the site map - build up the page title 'based on the site map node's place in the hierarchy Www~Chinaz~com
Dim output As String = String.Empty Dim currentNode As SiteMapNode = SiteMap.CurrentNode 站长.站
While currentNode IsNot Nothing If output.Length > 0 Then output = currentNode.Title & " :: " & output Else output = currentNode.Title End If 中国.站.长站
currentNode = currentNode.ParentNode End While
Chinaz_com
Return output End Function 中.国.站.长.站 |