D
doug
hi,
i am implementing a NavigationMenu. I am BINDING this to a MenuSource.
i wish to set enable = false for select menu items that are not applicable
based upon the state of a user.
i am always getting a NavigationMenu.Items with a count of 0. i thought
capturing at prerender would do the trick.
and yes, i am getting items and the menu is displayed correctly.
doug
work below.
protected void Page_PreRender(object sender, EventArgs e)
{
MasterPage m = (MasterPage)sender;
Menu mn = m.NavigationMenu;
// MenuItem homeMenuItem = mn.Items[0];
}
<asp:menu id="NavigationMenu"
disappearafter="2000"
staticdisplaylevels="2"
staticsubmenuindent="10"
orientation="Horizontal"
font-names="Arial"
datasourceid="MenuSource"
runat="server">
<staticmenuitemstyle backcolor="LightSteelBlue"
forecolor="Black"/>
</asp:menu>
<asp:SiteMapDataSource id="MenuSource"
runat="server"/>
i am implementing a NavigationMenu. I am BINDING this to a MenuSource.
i wish to set enable = false for select menu items that are not applicable
based upon the state of a user.
i am always getting a NavigationMenu.Items with a count of 0. i thought
capturing at prerender would do the trick.
and yes, i am getting items and the menu is displayed correctly.
doug
work below.
protected void Page_PreRender(object sender, EventArgs e)
{
MasterPage m = (MasterPage)sender;
Menu mn = m.NavigationMenu;
// MenuItem homeMenuItem = mn.Items[0];
}
<asp:menu id="NavigationMenu"
disappearafter="2000"
staticdisplaylevels="2"
staticsubmenuindent="10"
orientation="Horizontal"
font-names="Arial"
datasourceid="MenuSource"
runat="server">
<staticmenuitemstyle backcolor="LightSteelBlue"
forecolor="Black"/>
</asp:menu>
<asp:SiteMapDataSource id="MenuSource"
runat="server"/>