Im using updatepanel in my screen.. i have 2 pages when i click submit button in page1 then 开发者_如何学Cit ill be redirect to page2 ....in page2 i have one back button..i wrote click event onclick="history.go(-1)" when i click back it just redirect to page 1 but records already showned in page1 not displayed .how can i sove this problem? cai i use any scriptmanager?
History.go(-1) is a javascript function that just redirects to the previous page cached in the browser. There is no round trip to the server, the browser just serves the cached page when it first loaded, so form fields were not preserved since you did an AJAX call on the client. The data did not "POST" in the browser, so that is why you see the fields empty.
You can have your submit button to a postback to the server, and handle the redirection there to get the desired outcome. There you will have ViewState preserved, and can load the previous page with data preserved.
you can check this URL UpdatePanel + Back/Forward Browser Navigation http://rchern.wordpress.com/2008/05/11/updatepanel-backforward-browser-navigation/
I have also post code in this thread how can i get the same page with the click of back button of browser
精彩评论