如何在mvc中自动重定向后删除特定的历史记录

How to remove specfic history record after auto rediret in mvc

我的问题是
当我从索引视图提交表单时,我选择了 some
记录并发送到控制器并继续下一个视图
这是我的代码

@using ReportViewerForMvc;    
<script>
    $(document).ready(function () {
        window.setTimeout(function () {
            window.location.href = "/FOO/Login/Home";
        }, 300000);
    });  
</script>
@{
    ViewBag.Title = "Report Viewer";
}  

@Html.ReportViewer(ViewBag.ReportViewer as Microsoft.Reporting.WebForms.ReportViewer)

在此视图中,在应用条件后页面在主页上成功重定向,但是
当最终用户单击浏览器中的后退按钮时,它会显示与
相同的报告 结果

按下后退按钮时如何处理上一条记录
或不将历史记录保存在浏览器 cookie 或缓存中

您不能删除整个后退按钮历史记录。您所能做的就是使用 window.location.replace('url');

将最后一个条目替换为下一页

或者您可以使用以下方法禁用后退按钮:

<script type="text/javascript">
    window.onload = window.history.forward(0);
</script>