Imports System
Imports System.Data
Imports System.Configuration
Imports System.Collections
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Web.UI.HtmlControls

Imports System.Xml
Imports APNSoft.WebControls


Partial Public Class Menu_PopulateDynamically
    Inherits System.Web.UI.Page
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)

        'Set empty DataSource from XmlDocument
        myMenu.DataSource = New XmlDocument()
        myMenu.DataBind()


        'Get elements collection
        Dim _Elements As MenuElementCollection = myMenu.Elements

        'Add root elements
        _Elements.AddRootItem("Home")
        Dim _AboutUs As MenuElement = _Elements.AddRootItem("About Us")
        _Elements.AddRootSeparator()
        _Elements.AddRootItem("Products")
        _Elements.AddRootItem("Solutions")

        'Add child nodes for "About Us"
        _AboutUs.AddChildItem("Awards")
        _AboutUs.AddChildItem("Certificates")
        Dim _ContactUs As MenuElement = _AboutUs.AddChildItem("Contact Us")
        _AboutUs.AddChildSeparator()
        _AboutUs.AddChildItem("Financial Highlights")
        _AboutUs.AddChildItem("History")

        'Add child nodes for "Contact Us"
        _ContactUs.AddChildItem("Call Us")
        _ContactUs.AddChildItem("E-mail Us")

    End Sub
End Class