MenuBar - OnMenuItemClick

  • Thread starter Thread starter Lubomir
  • Start date Start date
L

Lubomir

Hi,

I have a MenuBar in a nested master page. I defined a click event handler
OnMenuItemClick. The problem is, when I click on a menu, the handler is not
called. I have such a feeling it could be something related to the fact, that
menu is in a nested master page. Do you have any idea what is wrong?

I am using Vista 64, VS 2008 and .NET 3.5

Thanks for help,
Lubomir
 
I am using this code:

<asp:Menu ID="aaa"
OnMenuItemClick="aaa_MenuItemClick"
runat="server" >
<Items>
<asp:MenuItem Text="xxx" navigateUrl="urlx..." Value="valueX" />
<asp:MenuItem Text="yyy" navigateUrl="urly..." Value="valueY" />
</Items>
</asp:Menu>

In code behind:
protected void aaa_MenuItemClick(object sender, MenuEventArgs e)
{
.....
}

When I run the code menu works fine, but when I set a breakpoint into
aaa_MenuItemClick, the program execution doesn't stop there. To check if
"break points work" I tried to put break point into Page_Load - it stopped
there as expected.

Still I think it has something to do with the fact that the menu control is
in a nested master page, and instead of my event handler the default one is
called by the framework.

/Lubomir
 
Yes! That solved the problem. Do you have any advise where I could read about
these details regarding ASP.NET? I haven't seen anywhere in the MSDN docs,
that "navigateurl" will make "Click" event not usable.

Thank you for your help,
Lubomir
 
Back
Top