Private Sub LoadXML() Dim IsAuthorised As Boolean = False Dim dr As DataRow = Nothing dsSiteMap.ReadXml(Server.MapPath("~/web.sitemap")) Dim LastSlashOccurence As Integer = 0 Dim NodeUrl As String = "" Dim sb As StringBuilder = New StringBuilder For Each dr In dsSiteMap.Tables(0).Rows If dr.Item(1).ToString <> "" And dr.Item(1).ToString <> "~/IACC_Home.aspx" Then LastSlashOccurence = dr.Item(1).ToString.LastIndexOf("/") + 1 NodeUrl = dr.Item(1).ToString.Substring(LastSlashOccurence, (Len(dr.Item(1).ToString) - LastSlashOccurence)) For Each RoleUrl In Session("UserMenuRoles").Split(New Char() {";"c}) If RoleUrl = "All" Then IsAuthorised = True Exit For End If If RoleUrl = NodeUrl Then IsAuthorised = True sb.Append("<ul>") sb.Append("<li id=navselected class=""navsingle nav0""><a href=" & dr.Item(1).ToString & " class=""navstaticlink"">" & dr.Item(3) & "</a></li>") sb.Append("</ul>") Dim Exit For End If Next End If Next End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)