简体   繁体   English

如何在保留上一页数据的同时返回asp.net中的上一页

[英]How to go back to previous page in asp.net while retaining the previous page data

I am having problem while using onclick="javascript:history.back();" 使用onclick =“ javascript:history.back();时出现问题。” with Aspnet. 与Aspnet。 In the first page i filled some data and click search button it show some results, i click on particular result for its details which navigate to the 2nd page but when i click on custom back button it refresh the page and all data set to initial values,when i use onclick="javascript:history.back();" 在第一页中,我填写了一些数据,然后单击“搜索”按钮,它显示了一些结果,我单击特定结果以获取其详细信息,该详细信息导航到第二页,但是当我单击“自定义后退”按钮时,它将刷新页面并将所有数据设置为初始值,当我使用onclick =“ javascript:history.back();”时 I get nothing but the page displays "webpage has expired." 我什么也没得到,但是页面显示“网页已过期”。

Thanks in advance! 提前致谢!

This is because you are using HTTP POST for your search page. 这是因为您将HTTP POST用于搜索页面。 If you use HTTP GET (putting your parameters in the querystring) - then the browser won't display this message. 如果您使用HTTP GET(在查询字符串中输入参数),则浏览器将不会显示此消息。

This has nothing specifically to do with ASP.NET. 这与ASP.NET无关。 It's a (sensible) browser behaviour to prevent you from repeating an action that may have undesirable impacts (for instance, sending two copies of an order) 这是(明智的)浏览器行为,可防止您重复执行可能会造成不良影响的操作(例如,发送订单的两个副本)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM