I suspect you must have switched autoeventwireup to false on the content
page. BTW, you can use <%@ MasterType %directive on content pages to
instruct compiler to automatically generate strongly-typed Master property.
Regardless your approach should work, you can also intercept menu click using
RaiseBubbleEvent method on master page, and then overriding OnBubbleEvent
method as follows:
master page:
protected void Menu_MenuItemClick(object sender, MenuEventArgs e)
{
RaiseBubbleEvent(sender, e);
}
content page:
protected override bool OnBubbleEvent(object source, EventArgs args)
{
if (args is MenuEventArgs)
{
// take appropriate action
}
else
{
return base.OnBubbleEvent(source, args);
}
}
hope this helps
--
Milosz Skalecki
MCAD
"tomix" wrote:
>
Hi,
I have a master page which contains a menu,i would like to handle post
back
In the content pages(MenuItemClick event)
I tried to do the following in the content page
BaseLayout master = this.Master as BaseLayout;
master.MainMenu.MenuItemClick += new
MenuEventHandler(MainMenu_MenuItemClick); //MainMenu us a property my
master page
But i dont get the events,note that if i am doing the same in the
master page it is ok
Thanks in advance.