当前位置:首页 > C# 中返回上一页问题代码

C# 中返回上一页问题代码

点击次数:1360  更新日期:2010-12-25
\n

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


\n

this.RegisterClientScriptBlock(“E”, “<script language=javascript>history.go(-2);</script>”);


\n

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


\n

Response.Write(“<script language=javascript>history.go(-2);</script>”);


\n

此处也要写为“-2”。跟直接写脚本的有所不同。


\n

来源:网络

\n