怎样在返回按钮的相应事件中实现浏览器后退按钮的效果??

解决方案 »

  1.   

    Button1.Attributes.Add("onclick","history.go(-1)");
      

  2.   

    可以将js代码加在btnd的代码中:<input type="button" value="返回" onclick="history.go(-1)" name="button"
      

  3.   

    也可以在pagelaod事件中加入:
    if(!this.postback())
    {
       Button1.Attributes.Add("onclick","history.go(-1)");
    }
      

  4.   

    <a href="#" onclick="javascript:window.history.back()">后退</a>
      

  5.   

    楼上的各位,Button1.Attributes.Add("onclick","history.go(-1)");这样是不行的如果在页面有其它重load页面的控件,这个go(-1)就要改成go(-2),go(-3)了,我测试了N遍了,用history.go()这种方法去返回上一页是问题多多呀!
      

  6.   

    楼上说的不错,但是Button1.Attributes.Add("onclick","history.go(-1)");你即使点N次你也回不去上页
      

  7.   

    点N次?你点N次后退按钮能回去的话,那理论上用history.go(-1) N次也能回去。如果你是从后退按钮边的快捷菜单那里直接选择后退N步的话,那你的代码也应该是history.go(-N)才对