我的default.aspx页面上有一个服务端button用来清除session后再关闭ie窗口
关闭ie窗口当然是用:
Response.Write("<script>window.opener=null;window.close()</script>");
一直都很正常的
可是今天我对default.aspx页面设置SmartNavigation="true"后,点button居然关不掉ie了,
客户端窗口左下脚还提示有错!
将SmartNavigation="true"取消后又正常了
请高手解惑!

解决方案 »

  1.   

    是的 它还会影响你的css 所以建议不用此属性
      

  2.   

    参考--persist the scroll position of an ASP.NET page:
    http://www.cnblogs.com/fengzhimei/archive/2004/07/04/21055.html
      

  3.   

    你是不是打了.net framework sp1,详见:
    http://webuc.net/dotey/archive/2004/10/14/1798.aspx
      

  4.   

    Response.Write("<script>window.opener=null;window.close()</script>");
    改为
    Page.RegisterStartupScript("","<script>window.opener=null;window.close()</script>");
      

  5.   

    SmartNavigation="true"我用的多了,好用得很呢~ 呵呵~~
      

  6.   

    Eddie005(暴走005):你的方法是可以把窗口关掉,但关之前左下脚还是会显示有错,不爽!
    cancersyf(fengzhimei):你留的链接我还在看!我觉得我现在的问题应该和css不是很有关系,因为除了那个button之外其他一切操作都很正常!
    问题似乎和下面这句很有关系:
    Response.Write("<script>window.opener=null;window.close()</script>");
    button完整的代码是:
    private void Button_ServerClick(object sender, System.Web.UI.ImageClickEventArgs e)
    {
    Session.RemoveAll();
    Response.Write("<script language='javascript'>window.opener=null;window.close();</script>");
    }