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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Page back button problem

Page back button problem

Scheduled Pinned Locked Moved ASP.NET
helpquestion
7 Posts 2 Posters 1 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.
  • M Offline
    M Offline
    macca24
    wrote on last edited by
    #1

    I use a gridview to display a list of records. Each record has a "View" button attached to it, which you can click and view the details of the particular record. In the "View" page there is a "back" button which you click to take you to the Gridview displaying the list. The problem I have is when I go to say page 2 on the Gridview and then I click to "View" a record, when I click the back button it will always return me to page 1 of the Gridview and never to the page I had just been on. Here is the code in the back button: Response.Redirect("DisplaySearch.aspx?Id=" & Request.QueryString.GetValues("Id")(0) & "&DateFrom=" & Request.QueryString.GetValues("DateFrom")(0) & "&DateTo=" & Request.QueryString.GetValues("DateTo")(0) & "&Name=" & Request.QueryString.GetValues("Name")(0) & "&BehalfOf=" & Request.QueryString.GetValues("BehalfOf")(0) & "&RefNo=" & Request.QueryString.GetValues("RefNo")(0) & "&Section=" & Request.QueryString.GetValues("Section")(0) & "") Anyone any ideas on this? macca

    V 1 Reply Last reply
    0
    • M macca24

      I use a gridview to display a list of records. Each record has a "View" button attached to it, which you can click and view the details of the particular record. In the "View" page there is a "back" button which you click to take you to the Gridview displaying the list. The problem I have is when I go to say page 2 on the Gridview and then I click to "View" a record, when I click the back button it will always return me to page 1 of the Gridview and never to the page I had just been on. Here is the code in the back button: Response.Redirect("DisplaySearch.aspx?Id=" & Request.QueryString.GetValues("Id")(0) & "&DateFrom=" & Request.QueryString.GetValues("DateFrom")(0) & "&DateTo=" & Request.QueryString.GetValues("DateTo")(0) & "&Name=" & Request.QueryString.GetValues("Name")(0) & "&BehalfOf=" & Request.QueryString.GetValues("BehalfOf")(0) & "&RefNo=" & Request.QueryString.GetValues("RefNo")(0) & "&Section=" & Request.QueryString.GetValues("Section")(0) & "") Anyone any ideas on this? macca

      V Offline
      V Offline
      Venkatesh Mookkan
      wrote on last edited by
      #2

      Send the PageIndex along with the View URL. Make use of it when you return back from the View page.

      [Venkatesh Mookkan] My: Website | Yahoo Group | Blog Spot

      M 1 Reply Last reply
      0
      • V Venkatesh Mookkan

        Send the PageIndex along with the View URL. Make use of it when you return back from the View page.

        [Venkatesh Mookkan] My: Website | Yahoo Group | Blog Spot

        M Offline
        M Offline
        macca24
        wrote on last edited by
        #3

        How do you do that?

        V 1 Reply Last reply
        0
        • M macca24

          How do you do that?

          V Offline
          V Offline
          Venkatesh Mookkan
          wrote on last edited by
          #4

          How are you navigating to the Detail page when the View button is clicked?

          [Venkatesh Mookkan] My: Website | Yahoo Group | Blog Spot

          M 1 Reply Last reply
          0
          • V Venkatesh Mookkan

            How are you navigating to the Detail page when the View button is clicked?

            [Venkatesh Mookkan] My: Website | Yahoo Group | Blog Spot

            M Offline
            M Offline
            macca24
            wrote on last edited by
            #5

            The following response.redirect : Response.Redirect("DisplaySearch.aspx?Id=" & Request.QueryString.GetValues("Id")(0) & "&DateFrom=" & Request.QueryString.GetValues("DateFrom")(0) & "&DateTo=" & Request.QueryString.GetValues("DateTo")(0) & "&Name=" & Request.QueryString.GetValues("Name")(0) & "&BehalfOf=" & Request.QueryString.GetValues("BehalfOf")(0) & "&RefNo=" & Request.QueryString.GetValues("RefNo")(0) & "&Section=" & Request.QueryString.GetValues("Section")(0) & "")

            V 1 Reply Last reply
            0
            • M macca24

              The following response.redirect : Response.Redirect("DisplaySearch.aspx?Id=" & Request.QueryString.GetValues("Id")(0) & "&DateFrom=" & Request.QueryString.GetValues("DateFrom")(0) & "&DateTo=" & Request.QueryString.GetValues("DateTo")(0) & "&Name=" & Request.QueryString.GetValues("Name")(0) & "&BehalfOf=" & Request.QueryString.GetValues("BehalfOf")(0) & "&RefNo=" & Request.QueryString.GetValues("RefNo")(0) & "&Section=" & Request.QueryString.GetValues("Section")(0) & "")

              V Offline
              V Offline
              Venkatesh Mookkan
              wrote on last edited by
              #6

              macca24 wrote:

              Response.Redirect("DisplaySearch.aspx?Id=" & Request.QueryString.GetValues("Id")(0) & "&DateFrom=" & Request.QueryString.GetValues("DateFrom")(0) & "&DateTo=" & Request.QueryString.GetValues("DateTo")(0) & "&Name=" & Request.QueryString.GetValues("Name")(0) & "&BehalfOf=" & Request.QueryString.GetValues("BehalfOf")(0) & "&RefNo=" & Request.QueryString.GetValues("RefNo")(0) & "&Section=" & Request.QueryString.GetValues("Section")(0) & "")

              Add the PageIndex of the GridView as a querystring along with this URL.

              [Venkatesh Mookkan] My: Website | Yahoo Group | Blog Spot

              M 1 Reply Last reply
              0
              • V Venkatesh Mookkan

                macca24 wrote:

                Response.Redirect("DisplaySearch.aspx?Id=" & Request.QueryString.GetValues("Id")(0) & "&DateFrom=" & Request.QueryString.GetValues("DateFrom")(0) & "&DateTo=" & Request.QueryString.GetValues("DateTo")(0) & "&Name=" & Request.QueryString.GetValues("Name")(0) & "&BehalfOf=" & Request.QueryString.GetValues("BehalfOf")(0) & "&RefNo=" & Request.QueryString.GetValues("RefNo")(0) & "&Section=" & Request.QueryString.GetValues("Section")(0) & "")

                Add the PageIndex of the GridView as a querystring along with this URL.

                [Venkatesh Mookkan] My: Website | Yahoo Group | Blog Spot

                M Offline
                M Offline
                macca24
                wrote on last edited by
                #7

                yes, but what I am asking is how do you do that?

                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