<input type=button value=刷新 onclick="window.location.reload()">
<input type=button value=前进 onclick="window.history.go(1)">
<input type=button value=后退 onclick="window.history.go(-1)">
<input type=button value=前进 onclick="window.history.forward()">
<input type=button value=后退 onclick="window.history.back()"> 后退+刷新<input type=button value=后退 onclick="window.history.go(-1);window.location.reload()">

在C# Web程序中,如为页面按钮写返回上一页代码

ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('Add a comment successful');javascript:history.go(-2);</script>");

其中,history.go(-2),要写为-2,因在按钮事件触发前,已刷新一次页面,所以应是-2。

相关文章:

  • 2021-12-12
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-08
  • 2021-05-22
  • 2021-07-20
  • 2022-01-22
相关资源
相似解决方案