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
|
|
|
| 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
| |
|
| 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
| |
|
| 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:
>
|
|
|
|
|