using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml;
using APNSoft.WebControls;
public partial class Menu_PopulateDynamically : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//Set empty DataSource from XmlDocument
myMenu.DataSource = new XmlDocument();
myMenu.DataBind();
//Get elements collection
MenuElementCollection _Elements = myMenu.Elements;
//Add root elements
_Elements.AddRootItem("Home");
MenuElement _AboutUs = _Elements.AddRootItem("About Us");
_Elements.AddRootSeparator();
_Elements.AddRootItem("Products");
_Elements.AddRootItem("Solutions");
//Add child nodes for "About Us"
_AboutUs.AddChildItem("Awards");
_AboutUs.AddChildItem("Certificates");
MenuElement _ContactUs = _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");
}
}
|