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

  • SEARCH
  • Home
  • 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 8404503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:36:59+00:00 2026-06-09T22:36:59+00:00

In most of the website, there is always a back to previous button. I

  • 0

In most of the website, there is always a “back” to previous button. I am wondering they are usually implemented.

Basically I am building a site with more than 5 levels page depth. As an example, page level goes like:

Advance Search => Search Result => Search Details => Apply For Job => Save Job

I need to make sure that user can navigate back to it’s previous level above, so from “search Details”, they should be able to click back and then goes back to the “Search Result” page with all its previous search criteria preserved.

I am currently storing the “back url” as part of the query string paramter and append the url as user dives in deeper. The issue with this is that when as user dives in more than 3 levels, the url get really long and messy.

What would be the best practice for asp.net MVC apps to deal with this kind of issue?

  • 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-06-09T22:37:00+00:00Added an answer on June 9, 2026 at 10:37 pm

    In an old web development platform I have used (several years back), this was solved using a built in function. The idea was that the server maintained some sort of internal collection of urls and mapped those to simple numbers. When you added a new url to the collection, the server would first check if that exact url was already present and if so just return the associated number. If the url you were adding was new, it would be added and a new number would be returned.

    A couple of samples to illustrate… Let’s assume the user starts out at page:

    http://foo.bar.com/search/
    

    I’ll referr to this page a “Page 1”. After adding the criteria to search for, the user will be shown the reuslts on page:

    http://foo.bar.com/search/results?jobTitle=CEO&etc&etc
    

    I’ll call this “Page 2”. On this page the user can click open a specific result and get to page:

    http://foo.bar.com/search/results/12313
    

    I’ll call that “Page 3”.

    To have the “back to previous” functionality for pages 2 and 3, they would need to be opened with one additional query parameter. When page 1 is generating the url for page 2, the server would call the utility method SaveUrl() (on some suitable class) and append the result to the querystring so the url for page 2 becomes:

    http://foo.bar.com/search/results?jobTitle=CEO&etc&etc&return_url=1
    

    Notice the new return_url=1 query parameter. Page 2 would then use the corresponding GetReturnUrl(1) method to fetch the url to use in the “back to previous” link. This call would bring back the url that was added previously, which would be http://foo.bar.com/search/.

    Going forward from page 2 to page 3 would also involve adding a new querystring parameter using the same SaveUrl(). The new url to page 3 would then be:

    http://foo.bar.com/search/results/12313?return_url=2
    

    On page 3, the “back to previous” page url would be fetched using GetReturnUrl(2), which would give back http://foo.bar.com/search/results?jobTitle=CEO&etc&etc&return_url=1.

    So this system works by storing the url of the current page and supplying that in the url to the next page. And since the url for the current page contains a reference to the current page’s previous page in the form of the query parameter, the back to previous trail is maintained.

    I thought I would explain this because I think it’s a smart way to handle the back to previous trail. I’m not claiming that it’s any sort of industry standard or best practise though…

    Edit: Some thoughts and considerations regarding this approach.

    Pros:

    • Easy way to store and retrieve urls without causing an ever longer querystring

    Cons:

    • Works as long as the url contains all the necessary state to go back.
    • Depending on the implementation details (global url collection? user specific url collection in Session? persist in Sql server?) it might cause issues in web farms (all servers need to agree on what url is stored as “1”).
    • Might cause memory issues in high traffic sites (but that also depend on the specific implementation)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just added a Facebook like button to my website, just the most basic
I see this on most website.whereby once the page is loaded, they have a
I am building a website which I host on Webfaction's most basic plan right
I am coding a website that uses SSL for most of the website. At
Most designers use 1024x768 as a baseline for website development. That allows them to
My website sends out html emails but most of my recipients are receiving them
My website was designed for firefox, and now that I've got most of the
I am running a php website and would like to pull in the most
For typical most typical internet facing websites when you login & leave the website
I am programming my first real PHP website and am wondering how to make

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.