Return to previous page with sitemap

peter liles 556 Reputation points
2022-04-12T14:02:00.08+00:00

I currently have the following nodes in my sitemap file

siteMapNode title="Account" url="~/MyProject\Seller\Sellor_Account.aspx" roles="Seller"

		siteMapNode title="Inbox" url="~/MyProject\Messaging\Inbox_User.aspx " 

I now want to add additional node that also links to Inbox_User.aspx file. But i am unable to because the return link when clicked returns to Seller_Account.aspx page instead of back to records2.aspx file?

siteMapNode title="Account" url="~/Market\records2.aspx"  roles="Services" 
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,237 questions
{count} votes

7 answers

Sort by: Most helpful
  1. peter liles 556 Reputation points
    2022-04-13T23:11:07.21+00:00

    It is the urls that must be unique. The titles do not matter unless under same hierarchy and get confused.
    I cannot link to same node address from two different file directories. When i add the new node url records2 and then link to Inbox_User page it still returns to sellor_account page instead of records2 page?


  2. peter liles 556 Reputation points
    2022-04-19T00:16:20.1+00:00

    When i link to Inbox_User page from either of the other two pages that reside in different directories when i click the return URL node on the sitemap it always links to the Sellor_Account page even though i visited from records2.
    I am working on a solution that involves a handler to replace the URL address that i came across. It proved messy, as i have child pages and had to store location in session state for reference. I do not recommend this approach as it has proven unreliable. sometimes the handler does not fire and jumping into and out of session creates errors. I have come up with a alternative plan that i am trying to implement though. Hopefully it will prove a success.
    If you still know of a fix, i would be grateful to know.


  3. AgaveJoe 26,181 Reputation points
    2022-04-19T13:34:55.783+00:00

    Please review your code. The URLs use a forward slash "/" not "\".

    The sitemap nodes you shared has an associated role. I have to assume you've setup role based security. It seems logical that if the resulting HTML link points to "Sellor_Account.aspx" then the user is in the seller roll.

    Please read the sitemap reference documentation to make sure you understand sitemaps with role security.

    ASP.NET Site-Map Security Trimming
    Securing ASP.NET Site Navigation

    When i link to Inbox_User page from either of the other two pages that reside in different directories when i click the return URL node on the sitemap it always links to the Sellor_Account page even though i visited from records2.

    What is a return URL node? Is this custom code that you wrote?

    0 comments No comments

  4. peter liles 556 Reputation points
    2022-04-22T14:01:06.893+00:00

    my records2 page resides inside root based Market folder whereas Seller_Account page resides inside sub Myproject/Market folder and Inbox_User resides inside sub MyProject/Membership folder.
    Does that clarify


  5. peter liles 556 Reputation points
    2022-04-27T20:33:07.767+00:00

    i have added the roles property to the sitemapnodes as referred to in previous comments, though they don't make a difference either?
    To solve the issue i was using the url referrer but i had to store in memory when traverse other pages so now i use the roles instead. That finally did the trick!
    The return url has you mention is the original source page.
    I must add that i did come across a explanation long ago about limitations with dynamic pages! i guess this is the problem as two individual pages try to access the same page.

    0 comments No comments