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. how to maintain viewstate?

how to maintain viewstate?

Scheduled Pinned Locked Moved ASP.NET
javascripthtmltutorialquestion
9 Posts 4 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.
  • K Offline
    K Offline
    kripa21
    wrote on last edited by
    #1

    I have search page. On search button, result is coming with View_detail_btn button. View_detail_btn redirects the page to detail.aspx. detail.aspx page have the button to go back to search result page I used html button for go back n call thr javascript function goToBackPage(){                   window.history.back(); } It goes back but search page is refreshing n all result is going I want all search reult n criateria on page What i do to solve this?

    D A P 3 Replies Last reply
    0
    • K kripa21

      I have search page. On search button, result is coming with View_detail_btn button. View_detail_btn redirects the page to detail.aspx. detail.aspx page have the button to go back to search result page I used html button for go back n call thr javascript function goToBackPage(){                   window.history.back(); } It goes back but search page is refreshing n all result is going I want all search reult n criateria on page What i do to solve this?

      D Offline
      D Offline
      Dinesh Mani
      wrote on last edited by
      #2

      I remember answering the very same question just a few days ago. Anyway, all you need to do is redirect to the details page from the client and not the server. If you do so your search results will be intact when you traverse back via history.back to the search page. HTH!

      K 1 Reply Last reply
      0
      • K kripa21

        I have search page. On search button, result is coming with View_detail_btn button. View_detail_btn redirects the page to detail.aspx. detail.aspx page have the button to go back to search result page I used html button for go back n call thr javascript function goToBackPage(){                   window.history.back(); } It goes back but search page is refreshing n all result is going I want all search reult n criateria on page What i do to solve this?

        A Offline
        A Offline
        Abhishek Sur
        wrote on last edited by
        #3

        Dont ever use history.back crap from your web site. Rather always go for an AJAX call, or full postback for your back button. I always like to disable that back button in the browser. It is very old concept to maintain the history. ;)

        Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


        My Latest Articles-->****
        InfoBox Visual Studio 2010 Extension
        Windows7 API Code Pack
        Simplify Code Using NDepend**

        K 1 Reply Last reply
        0
        • D Dinesh Mani

          I remember answering the very same question just a few days ago. Anyway, all you need to do is redirect to the details page from the client and not the server. If you do so your search results will be intact when you traverse back via history.back to the search page. HTH!

          K Offline
          K Offline
          kripa21
          wrote on last edited by
          #4

          plz, give me more details, How redirect page? I don't know much about serverside redirection n clientside Rt now i redirect page using response.redirect

          D 1 Reply Last reply
          0
          • A Abhishek Sur

            Dont ever use history.back crap from your web site. Rather always go for an AJAX call, or full postback for your back button. I always like to disable that back button in the browser. It is very old concept to maintain the history. ;)

            Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


            My Latest Articles-->****
            InfoBox Visual Studio 2010 Extension
            Windows7 API Code Pack
            Simplify Code Using NDepend**

            K Offline
            K Offline
            kripa21
            wrote on last edited by
            #5

            Hello sir, plz tell me how to use ajax call or full postbox in brief or just forward me link if any

            modified on Wednesday, February 3, 2010 3:25 AM

            1 Reply Last reply
            0
            • K kripa21

              plz, give me more details, How redirect page? I don't know much about serverside redirection n clientside Rt now i redirect page using response.redirect

              D Offline
              D Offline
              Dinesh Mani
              wrote on last edited by
              #6

              When you use Response.Redirect from an event handler in the code behind it is called Server redirection. When you use links or window.location from the HTML then it is called Client redirection. It is not straight forward to change server redirect to client redirect as it might involve a good amount of behavioral changes, but in most cases it would be a simple code change. The crux here is that you would have to generate the redirect URL, the one you use in the Response.Redirect on the server event on the button click, when you generate the search result and make it available as a HTML hyperlink for the user to click and navigate. Hope I make sense to you.

              K 1 Reply Last reply
              0
              • K kripa21

                I have search page. On search button, result is coming with View_detail_btn button. View_detail_btn redirects the page to detail.aspx. detail.aspx page have the button to go back to search result page I used html button for go back n call thr javascript function goToBackPage(){                   window.history.back(); } It goes back but search page is refreshing n all result is going I want all search reult n criateria on page What i do to solve this?

                P Offline
                P Offline
                Palash Biswas
                wrote on last edited by
                #7

                You can cache your all search page details into a cache and repopulate the search page when you come back from cache... Thanks

                K 1 Reply Last reply
                0
                • D Dinesh Mani

                  When you use Response.Redirect from an event handler in the code behind it is called Server redirection. When you use links or window.location from the HTML then it is called Client redirection. It is not straight forward to change server redirect to client redirect as it might involve a good amount of behavioral changes, but in most cases it would be a simple code change. The crux here is that you would have to generate the redirect URL, the one you use in the Response.Redirect on the server event on the button click, when you generate the search result and make it available as a HTML hyperlink for the user to click and navigate. Hope I make sense to you.

                  K Offline
                  K Offline
                  kripa21
                  wrote on last edited by
                  #8

                  thanx

                  1 Reply Last reply
                  0
                  • P Palash Biswas

                    You can cache your all search page details into a cache and repopulate the search page when you come back from cache... Thanks

                    K Offline
                    K Offline
                    kripa21
                    wrote on last edited by
                    #9

                    Thanx if u can share any example/ more detail then it will more helpful to me, Coz i didn't used cache yet

                    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