Hello,
I am trying to load information from a XML file using only the nodes
which attribute footer=true.
I created the following code:
Dim siteMap As New System.Xml.XmlD ocument
siteMap.Load(Ht tpContext.Curre nt.Server.MapPa th(Me.SiteMapUr l))
Dim siteMapNodeList As XmlNodeList =
siteMap.SelectN odes("sitemapno de[@footer='true']")
Dim iSiteMapNode As Integer
' Loop through each node in XML node list
For iSiteMapNode = 0 To siteMapNodeList .Count - 1
' Create new hyperlink
Dim link As New HyperLink
' Define hyperlink properties
With link
.ID = "by27f_h" &
siteMapNodeList (iSiteMapNode). Attributes("tit le").Value
.NavigateUrl =
siteMapNodeList (iSiteMapNode). Attributes("url ").Value
.Text =
siteMapNodeList (iSiteMapNode). Attributes("tit le").Value
.ToolTip =
siteMapNodeList (iSiteMapNode). Attributes("tit le").Value
End With
Next
I am not getting anything.
My XML file is as follows:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap
xmlns = "http://schemas.microso ft.com/ASPNet/SiteMap-File-1.0" >
<siteMapNode>
<siteMapNode
url = "~/Default.ASPx"
title = "Home"
description = "Desc1"
footer = "true" />
<siteMapNode
url = "~/Contacts.ASPx"
title = "Contactos"
description = "Desc2"
footer = "true" />
</siteMapNode>
</siteMap>
Could you tell me what am I doing wrong?
I can't understand why I don't get any values.
Thanks,
Miguel
I am trying to load information from a XML file using only the nodes
which attribute footer=true.
I created the following code:
Dim siteMap As New System.Xml.XmlD ocument
siteMap.Load(Ht tpContext.Curre nt.Server.MapPa th(Me.SiteMapUr l))
Dim siteMapNodeList As XmlNodeList =
siteMap.SelectN odes("sitemapno de[@footer='true']")
Dim iSiteMapNode As Integer
' Loop through each node in XML node list
For iSiteMapNode = 0 To siteMapNodeList .Count - 1
' Create new hyperlink
Dim link As New HyperLink
' Define hyperlink properties
With link
.ID = "by27f_h" &
siteMapNodeList (iSiteMapNode). Attributes("tit le").Value
.NavigateUrl =
siteMapNodeList (iSiteMapNode). Attributes("url ").Value
.Text =
siteMapNodeList (iSiteMapNode). Attributes("tit le").Value
.ToolTip =
siteMapNodeList (iSiteMapNode). Attributes("tit le").Value
End With
Next
I am not getting anything.
My XML file is as follows:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap
xmlns = "http://schemas.microso ft.com/ASPNet/SiteMap-File-1.0" >
<siteMapNode>
<siteMapNode
url = "~/Default.ASPx"
title = "Home"
description = "Desc1"
footer = "true" />
<siteMapNode
url = "~/Contacts.ASPx"
title = "Contactos"
description = "Desc2"
footer = "true" />
</siteMapNode>
</siteMap>
Could you tell me what am I doing wrong?
I can't understand why I don't get any values.
Thanks,
Miguel
Comment