
Partial Class Programming
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Try
            lblCurrentNode.Text = SiteMap.CurrentNode.Title

            If SiteMap.CurrentNode.HasChildNodes Then
                For Each childNode As SiteMapNode In SiteMap.CurrentNode.ChildNodes
                    lblChildNodes.Text += childNode.Title & "<br/>"
                Next
            End If
        Catch generatedExceptionName As System.NullReferenceException
            lblCurrentNode.Text = "Plik xml nie jest mapą witryny!"

        Catch ex As Exception
            lblCurrentNode.Text = "Wyjątek! " & ex.Message
        End Try

    End Sub
End Class
