Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Back to same position on page

Back to same position on page

Scheduled Pinned Locked Moved ASP.NET
javascriptcssquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    BobsAfro
    wrote on last edited by
    #1

    I have a grid view with some links to take you to details of the item in the grid. On the details page is a link to go back to the page containing the grid. I want this link to return people to the same position on the page like the back button does. I can't use "javascript:history.back()" because if they sort items on the details page it will no longer take them back to the grid but just 'unsort' the current page. I have anchors on the page which kind of work. But they will always put the grid item at the top of the page, And if they clciked it at the bottom it will be quite a different position. Any ideas anyone? Sorry this is a bit long.

    T M 2 Replies Last reply
    0
    • B BobsAfro

      I have a grid view with some links to take you to details of the item in the grid. On the details page is a link to go back to the page containing the grid. I want this link to return people to the same position on the page like the back button does. I can't use "javascript:history.back()" because if they sort items on the details page it will no longer take them back to the grid but just 'unsort' the current page. I have anchors on the page which kind of work. But they will always put the grid item at the top of the page, And if they clciked it at the bottom it will be quite a different position. Any ideas anyone? Sorry this is a bit long.

      T Offline
      T Offline
      ToddHileHoffer
      wrote on last edited by
      #2

      What you can do is pass the id of a control to your page in the querystring, or store as a session item or cookie or however you chose. Then in the codebehind on page load set focus to that control.

      GameFly free trial

      1 Reply Last reply
      0
      • B BobsAfro

        I have a grid view with some links to take you to details of the item in the grid. On the details page is a link to go back to the page containing the grid. I want this link to return people to the same position on the page like the back button does. I can't use "javascript:history.back()" because if they sort items on the details page it will no longer take them back to the grid but just 'unsort' the current page. I have anchors on the page which kind of work. But they will always put the grid item at the top of the page, And if they clciked it at the bottom it will be quite a different position. Any ideas anyone? Sorry this is a bit long.

        M Offline
        M Offline
        marcin rawicki
        wrote on last edited by
        #3

        Try this one: http://www.codeproject.com/aspnet/lili2.asp It helped me ;-)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups