Tuesday, March 13, 2012

SiteMapResolve Event does not fire

I have a simple wesite with a SiteMap. I am using the Menu Control for
navigation. Some of the URLs in the site map refer to external pages
outside of the website. When a user clicks on an "external" menu item I
need to indicate on my site that the user has accessed the external link.
To do this I am using the SiteMapResolve event of the SiteMap object using
the code below:
The SiteMapResolve event was firing just fine and then all of a sudden it
stopped working.
Any Ideas?
jay lindsay
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
AddHandler SiteMap.SiteMapResolve, AddressOf Me.MyNavigation
End Sub
Private Function MyNavigation(ByVal sender As Object, ByVal e As
SiteMapResolveEventArgs) As SiteMapNode
Dim currentNode As SiteMapNode = SiteMap.CurrentNode.Clone(True)
'Dim x As String = currentNode.Title
'Dim y As String = currentNode.Url
Return (currentNode)
End FunctionI rebooted my pc and the event started working. That is disconcerting.
However, I have learned that the SiteMapResolve event does not fire when the
URL is external. Is this correct?
I want a general way to handle some things each time a menuitem is clicked
(before transfering to the new page) whether the URL is internal or
external.
Any good suggestions. I can think of some hacks but I want this to be
simple and straight forward.
Jay Lindsay
"Jay" <someone@.nowhere.com> wrote in message
news:uAID9llMGHA.2628@.TK2MSFTNGP15.phx.gbl...
>I have a simple wesite with a SiteMap. I am using the Menu Control for
>navigation. Some of the URLs in the site map refer to external pages
>outside of the website. When a user clicks on an "external" menu item I
>need to indicate on my site that the user has accessed the external link.
>To do this I am using the SiteMapResolve event of the SiteMap object using
>the code below:
> The SiteMapResolve event was firing just fine and then all of a sudden it
> stopped working.
> Any Ideas?
> jay lindsay
>
> Protected Sub Page_Load(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles Me.Load
> AddHandler SiteMap.SiteMapResolve, AddressOf Me.MyNavigation
> End Sub
> Private Function MyNavigation(ByVal sender As Object, ByVal e As
> SiteMapResolveEventArgs) As SiteMapNode
> Dim currentNode As SiteMapNode = SiteMap.CurrentNode.Clone(True)
> 'Dim x As String = currentNode.Title
> 'Dim y As String = currentNode.Url
> Return (currentNode)
> End Function
>
>

0 comments:

Post a Comment