For Programmers: Free Programming Magazines  


Home > Archive > ASP .NET Webcontrols > January 2006 > Catching event in Menu control when bound with sitemap









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Catching event in Menu control when bound with sitemap
Shem

2006-01-25, 7:57 am

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
DWS

2006-01-29, 7:01 pm

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

Shem

2006-01-31, 7:08 pm

Thanks a lot mate!

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

"DWS" wrote:
[color=darkred]
> 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:
>
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com