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: <asp:LoginName
ID="LoginName1" runat="server" />
</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
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: <asp:LoginName
ID="LoginName1" runat="server" />
</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