Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7368259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T03:38:39+00:00 2026-05-29T03:38:39+00:00

My ASP.NET (VB.NET) application uses SiteMaps to display a navigation menu on the top

  • 0

My ASP.NET (VB.NET) application uses SiteMaps to display a navigation menu on the top of each page. In the code behind of some of the pages, I am dynamically amending the URLs of the SiteMaps nodes (to add parameters to the end of the URL) e.g. say I have somePage.aspx.vb and anotherPage.aspx.vb and they both contain the following:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    AddHandler SiteMap.SiteMapResolve, AddressOf Me.ExpandForumPaths

    If Not Page.IsPostBack Then
        Setup()
    End If

End Sub

Private Function ExpandForumPaths(ByVal sender As Object, ByVal e As SiteMapResolveEventArgs) As SiteMapNode
    Dim currentNode As SiteMapNode = Nothing

    Try
        currentNode = SiteMap.CurrentNode.Clone(True)
        ' Do some stuff

    Catch ex As Exception
        ' Do nothing - don't want app falling over because of issue with nav menu
    End Try

    Return currentNode
End Function

My problem is this, if I am in the code behind of somePage.aspx and I do a Response.Redirect(“~/anotherPage.aspx”) – then, when anotherPage.aspx.vb is being loaded, it is the ExpandFormumPaths method of somePage.aspx.vb that is hit, not that of anotherPage.aspx.vb.

My understanding is that a Response.Redirect tells the browser to do a new request to the supplied URL – I don’t know why it’s hitting the method belonging to the previous page.

I’ve tried amending the method names (i.e. not having the node processing method called ExpandFormumPaths in all classes) but I still encountered the same issue.

When I go straight to the URL of anotherPage.aspx the correct method is hit, it is only when I am using Response.Redirect that this happens.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T03:38:39+00:00Added an answer on May 29, 2026 at 3:38 am

    Got this sorted by the way – just in case anyone else has the same issue. I included this in the same code behind files.

    ' Remove the site map resolver on unload. Causes all kinds of weird issues if we don't do this.
    Private Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Unload
        RemoveHandler SiteMap.SiteMapResolve, AddressOf Me.ExpandForumPaths
    
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have an ASP.NET application that uses the Infragistics WebSchedule control to display appointments
I have an ASP.NET application that uses a master page configuration. What I'd like
You are implementing an ASP.NET application that uses data-bound GridView controls in multiple pages.
my asp.net application uses some sequences to generate tables primary keys. Db administrators have
I have an ASP.NET application which uses JQuery datepicker for picking dates in some
I have an ASP.net application that uses some common business object that we have
I have existing code for an ASP .NET application that uses reflection to load
I am working with a third party asp.net application that uses master pages and
I'm writing an ASP.net application that uses Windows Identity Foundation. My ASP.net application uses
I have an ASP.NET application that uses a custom .NET library (a .DLL file).

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.