SiteMapNode.ToString Method ()
.NET Framework (current version)
Converts the value of this instance of the SiteMapNode class to its equivalent string representation.
Assembly: System.Web (in System.Web.dll)
The ToString method returns the Title property of a SiteMapNode object.
The following code example demonstrates how to compare the ToString method to the Url and Title properties of a SiteMapNode object.
<%@ Page Language="VB" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <SCRIPT runat="server"> Private Sub Page_Load(Sender As Object, E As EventArgs) ' Navigate the SiteMap built by the default SiteMapProvider. Response.Write(SiteMap.RootNode.ToString() & "<BR>") Response.Write(SiteMap.RootNode.Url & "<BR>") Response.Write(SiteMap.RootNode.Title & "<BR>") Dim sitemapnode As SiteMapNode For Each sitemapnode In SiteMap.RootNode.ChildNodes ' Iterate through the ChildNodes SiteMapNodesCollection ' maintained by the RootNode. Response.Write(sitemapnode.Url & "<BR>" ) Next Dim providers As IDictionaryEnumerator = SiteMap.Providers.GetEnumerator() While (providers.MoveNext()) Response.Write(providers.Current) Response.Write(" ") Response.Write("<BR>") End While End Sub ' Page_Load </SCRIPT>
.NET Framework
Available since 2.0
Available since 2.0
Show: