void Page_LoadComplete(object sender, EventArgs e) { MenuBase parent = this.ParentMenu; //if (parent == null) //{ // throw new InvalidOperationException("The MenuItem can be apllyed for Menu only!"); //} if (parent != null) { parent.BeforeClientInit += Menu_BeforeClientInit; } }
protected virtual void AfterItemAdd(MenuBase item) { this.Controls.Add(item); }
void Menu_AfterItemAdd(MenuBase item) { item.Items.AfterItemAdd += MenuItems_AfterItemAdd; }