Home All Groups Group Topic Archive Search About

Catching event in Menu control when bound with sitemap

Author
25 Jan 2006 11:51 AM
Shem
Hi Folks,

I am running 2005 c# and I have dynaically built a site map which is
autobound to a menu control, but for whatever reasons, i now cannot catch the
menu_click event. I think this is maybe due to the fact that the sitemap
structure automatically posts it to the new distinct url. I don't think this
is right?

Has anybody else had problems catching the events? and or solutions?

Thanks in advance

Author
29 Jan 2006 5:25 PM
DWS
in the MenuItemDataBound event set the navigateurl to "" to stop the auto
navigation and you'll get the click event.

Protected Sub Menu2_MenuItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.MenuEventArgs) Handles Menu2.MenuItemDataBound
        e.Item.NavigateUrl = ""
End Sub

Good Luck
DWS

Show quoteHide quote
"Shem" wrote:

> Hi Folks,
>
> I am running 2005 c# and I have dynaically built a site map which is
> autobound to a menu control, but for whatever reasons, i now cannot catch the
> menu_click event. I think this is maybe due to the fact that the sitemap
> structure automatically posts it to the new distinct url. I don't think this
> is right?
>
> Has anybody else had problems catching the events? and or solutions?
>
> Thanks in advance
Author
31 Jan 2006 2:27 PM
Shem
Thanks a lot mate!

This worked first time and has saved me no end of greef. Thanks again

Show quoteHide quote
"DWS" wrote:

> in the MenuItemDataBound event set the navigateurl to "" to stop the auto
> navigation and you'll get the click event.
>
> Protected Sub Menu2_MenuItemDataBound(ByVal sender As Object, ByVal e As
> System.Web.UI.WebControls.MenuEventArgs) Handles Menu2.MenuItemDataBound
>         e.Item.NavigateUrl = ""
> End Sub
>
> Good Luck
> DWS
>
> "Shem" wrote:
>
> > Hi Folks,
> >
> > I am running 2005 c# and I have dynaically built a site map which is
> > autobound to a menu control, but for whatever reasons, i now cannot catch the
> > menu_click event. I think this is maybe due to the fact that the sitemap
> > structure automatically posts it to the new distinct url. I don't think this
> > is right?
> >
> > Has anybody else had problems catching the events? and or solutions?
> >
> > Thanks in advance