Dropped a menu control (mnuMain) on a webform, set the CssClass to
"IE8Fix { z-index: 999}" to get round the IE8 problem and then on
PageLoad attempted to populate the top menu (Top) with a couple of
entries Sub1 and Sub2. Much to my frustration only "Sub1" is visible.
On inspecting html code, the Sub2 is rendered in exactly the same way
as Sub1. Any help on this will be much appreciated.
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
PopulateMenu();
}
}
private void PopulateMenu()
{
MenuItem rootItem = new MenuItem("Top");
MenuItem childItem1 = new MenuItem("Sub1");
MenuItem childItem2 = new MenuItem("Sub2");
rootItem.ChildItems.Add(childItem1);
rootItem.ChildItems.Add(childItem2);
menuMain.Items.Add(rootItem);
menuMain.Items.Add(rootItem);
}
}