I'm setting the MenuItems for an asp:Menu dynamically. So here's the ASPX:
<asp:Menu ID="FlowMenu1" runat="server" CssClass="menu" EnableViewState="false" Visible="true" IncludeStyleBlock="false" Orientation="Horizontal" OnMenuItemClick="FlowMenu1Clicked">
</asp:Menu>
... and here's a snippet from the code-behind:
MenuItem saveDraft1 = new MenuItem();
saveDraft1.Text = "Save Draft";
saveDraft1.Value = " ";
if ( ((position == "Employee") && ((documentState == "WORKING") ||
(documentState == "DRAFT"))) ||
((position == "First Evaluator") && ((documentState == "NEW") ||
(documentState == "REVIEW") ||
(documentState == "CONVERSATION") ||
(documentState == "CRITIQUE"))) ||
((position == "Second Evaluator") && ((documentState == "FEEDBACK") ||
(documentState == "SCRUTINY"))) ||
((position == "Third Evaluator") && ((documentState == "REACTION") ||
(documentState == "INSPECTION"))) )
{
FlowMenu1.Items.Add(saveDraft1);
}
I've seen these problems suggested, but none of them have worked:
* The OnMenuItemClick procedure is defined (but when I put a breakpoint at the beginning of the procedure, it doesn't even seem like the event is firing)
* There's no AutoPostBack property to set on either the Menu or the MenuItem objects
* There's no NavigateUrl property set on the MenuItems (nor do I want there to be)
* There's no ImageUrl property set on the MenuItems (nor do I want there to be)
* Both the MenuItem.Text and the MenuItem.Value properties are set for all MenuItems
I've tried everything I can think of, including putting the menu control on its own panel. Thank you for any insight you can lend.