MenuItemClick for Menu control not fired

B

biru

On my master page, I have a Menu control with sitemap datasource. This
menu control is placed inside LoggedInTemplate for a LoginView control.

The code in .aspx page is as follows:

<td style="background-color: #FFFFFF;">
<asp:LoginView ID="LoginView1" runat="server">
<LoggedInTemplate>
<table border="0" width="100%" cellpadding="0"
cellspacing="0">
<tr>
<td style="padding-left: 10px;">
<asp:Menu ID="mnuSite" runat="server"
DataSourceID="SiteMapDataSource1" Orientation="Horizontal"
StaticDisplayLevels="2" ForeColor="#336699" DynamicHorizontalOffset="5"
DynamicVerticalOffset="5"
StaticItemFormatString="{0}"
StaticSubMenuIndent="5px" StaticEnableDefaultPopOutImage="False"

OnMenuItemDataBound="mnuSite_MenuItemDataBound"

OnMenuItemClick="mnuSite_MenuItemClick" >
<DynamicMenuStyle BorderColor="#999966"
BorderStyle="Solid" BorderWidth="1px" HorizontalPadding="5px"
VerticalPadding="2px" />
</asp:Menu>
</td>
<td style="text-align: right; color: #847F6B;">
Username:&nbsp;&nbsp;<asp:LoginName
ID="LoginName1" runat="server" />&nbsp;&nbsp;
</td>
</tr>
</table>
</LoggedInTemplate>
</asp:LoginView>
</td>

In the .aspx.cs file, I have the following code:
protected void mnuSite_MenuItemClick(object sender, MenuEventArgs e)
{
if (e.Item.Value == "CUSTOM REPORTS")
ResetUserVariables();
}

However anytime I click on any of the menu items, it won't fire the
event handler in my code. It doesn't matter whether the item clicked
has a NavigateUrl property or not. It still won't fire the event
handler.

Can anyone help me to solve this problem?

TIA

-biru
 

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,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top