NavigationMenu and MenuItems with Databinding

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"/>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top