Back button in ajax update panel not working

I am using updatepanel on my screen. I have 2 pages when I click the "Submit" button on page1, then it will be redirected to page2 .... on page2 I have one back button. I wrote the click event onclick = "history.go (-1)" when I click back, it just redirects to page 1, but the entries shown on page 1 are not displayed. How can I solve this problem? cai do i use any screenwriter?

+3
source share
2 answers

History.go (-1) is a javascript function that simply redirects to the previous page cached in the browser. There is no return trip on the server, the browser simply serves the cached page on the first load, so the form fields were not saved since you made an AJAX call on the client. The data was not "POST" in the browser, so you see that the fields are empty.

You can send the send button for postback to the server and process the redirect there to get the desired result. There you save the ViewState and you can load the previous page with the saved data.

+4
source
+3

Source: https://habr.com/ru/post/1738617/


All Articles