开发者

Back button in ajax update panel not working

开发者 https://www.devze.com 2022-12-25 04:22 出处:网络
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=\

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

0

精彩评论

暂无评论...
验证码 换一张
取 消