问题描述
大家好,
我有一个asp.net菜单,其中包含一些SubMenuItems,如下所示
编辑
切
复制
粘贴
现在,我在页面的PreRenderEvent中向此菜单添加了一些SubMenuItem,
编辑
切
复制
粘贴
插入//这是动态生成的SubMenuItem
更新//这是动态生成的SubMenuItem
Hello EveryOne,
I have a asp.net menu which contains Some SubMenuItems like this follow
Edit
Cut
Copy
Paste
Now i have added few more SubMenuItem to this Menu like this in the PreRenderEvent of the Page
Edit
Cut
Copy
Paste
Insert//This is dynamic generated SubMenuItem
Update//This is dynamic generated SubMenuItem
protected override void OnPreRenderComplete(EventArgs e)
{
base.OnPreRenderComplete(e);
DefaultMasterPage master = (DefaultMasterPage)this.Master;
if (master.MainMenu.Items[0].ChildItems[1].ChildItems.Count < 8)
{
master.MainMenu.Items[0].ChildItems[1].ChildItems.Add(new MenuItem("Insert", "Insert", "", ""));
master.MainMenu.Items[0].ChildItems[1].ChildItems.Add(new MenuItem("Update", "Update", "", ""));
}
}
我想在此子菜单项中添加样式.请向我提供一些适当的解决方案.
I want to add the Style to this Submenu items .Please provide me some appropriate Solution.
推荐答案
这篇关于如何将MenuItem Style设置为动态添加的项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!