<a href="javascript:history.back(-1)">
<A class="font9_grey2" href="photo.html" target="_parent">
在C# Web程序中,如为页面按钮写返回上一页代码
this.RegisterClientScriptBlock("E", "<script language=javascript>history.go(-2);</script>");
其中,history.go(-2),要写为-2,因在按钮事件触发前,已刷新一次页面,所以应是-2。
Response.Write("<script language=javascript>history.go(-2);</script>");
此处也要写为“-2”。跟直接写脚本的有所不同。
本文介绍了在C# Web应用程序中实现返回上一页功能的方法。通过使用history.go(-2)来确保从当前页面正确返回,因为页面加载前已经发生了一次刷新。文中还对比了直接在脚本中写入的不同之处。
1322

被折叠的 条评论
为什么被折叠?



