2011-05-11 73 views

回答

1

如下您可以刪除特定的菜單項:

MenuItem mnuItem = mnu.FindItem(""); // Find particular item 
mnu.Items.Remove(mnuItem); 
1

我認爲你需要從菜單中刪除:

protected void MyMenu_MenuItemDataBound(object sender, MenuEventArgs e) 
    { 
     if (e.Item.Text == "Menu Item To Remove") 
     { 
      MyMenu.Items.Remove(e.Item); 
     } 
    } 
1

試試這個:

Public Boolean Condition 
{ 
    get { ... } 
} 


<asp:Menu ID="..." runat="server"> 
    <Items> 
    <asp:MenuItem Text="..." Value="..." Visible="<%# this.Condition %>" /> 

    ..... 
    </Items> 
</asp:Menu>