The following script and menu are both placed in my master page. When I click on a menu item I am taken to the page I expect just fine. However, I also want to do some processing when a menu item is clicked (in addition to going to the new page). Thus I am trying to call the Menu_Posts_MenuItemClick procedure. But nothing happens when I click on a menu item (other than navigating to the new page...which does work). For testing I tried to do something simple like updating a label but even that doesn't work.
Does anybody have any ideas as to what I am missing or doing wrong.
<script runat="server">
Sub Menu_Posts_MenuItemClick(ByVal sender As Object, ByVal e As MenuEventArgs) Handles Menu_Posts.MenuItemClick
Dim Index As Integer = Int32.Parse(e.Item.Value)
Dim label1 As Label = CType(Me.FindControl("label1"), Label)
label1.Text = 1 'Index
End Sub
</script>
<asp:Menu
ID="Menu_Posts"
runat="server"
DataSourceID="PCSiteMapDataSource"
Orientation="Horizontal"
OnMenuItemClick="Menu_Posts_MenuItemClick"
style="position: relative; top: -18px"
StaticEnableDefaultPopOutImage="False">
<StaticMenuItemStyle
Font-Names="Arial"
Font-Size="12px"
ForeColor="White" />
<DynamicMenuItemStyle
Font-Names="Arial"
Font-Size="12px"
ForeColor="Yellow" />
<StaticItemTemplate>
<%# Eval("Text") %>
</StaticItemTemplate>
</asp:Menu>
Thanks in advance...MDCragg