Page.RegisterStartupScript("key1","<script language=\"javascript\">opener.window.location.reload();window.close();</script>");请问这句怎么不能正常执行呢?直接放在按钮的onclick中就行 用Response.Write也试过了,不行的,那要怎么办才能让它自动执行呢?

解决方案 »

  1.   

    你的response.write是怎么写的?写出来我看看
      

  2.   

    现有:1.aspx和 2.aspx   default.aspx:
    --------------------------------------
    <IFRAME src="1.aspx"></IFRAME>
    <IFRAME src="2.aspx"></IFRAME>
    请问怎么才能通过1.aspx来刷新default.aspx呢?
      

  3.   

    Response.Write("<script>window.parent.top1.location.href='log.aspx';</script>");
    Response.Write("<script>window.parent.main.location.href='login.aspx';</script>");
      

  4.   

    Page.RegisterStartupScript("key1","<script language=\"javascript\">opener.window.location.reload();window.close();</script>");----------------->Page.RegisterStartupScript("key1","<script language=javascript>window.opener.location.reload();window.close();</script>");
      

  5.   

    试了下还是不行的,default.aspx中没有其它什么东西了,就只引入了两个页面,1.aspx和2.aspx
      

  6.   

    1.htm
    ------------------------------------------
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>无标题文档</title>
    </head>
    <a href="#" onClick="window.opener.location.reload();window.close();">刷新default.htm</a>
    <body>
    </body>
    </html>2.htm
    -----------------------------------------
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>无标题文档</title>
    </head>
    <a href="#" >2.htm</a>
    <body>
    </body>
    </html>default.htm
    -----------------------------------
    <IFRAME src="1.htm"></IFRAME>
    <IFRAME src="2.htm"></IFRAME>
      

  7.   

    Response.Write("<script>window.parent.top1.location.href='log.aspx';</script>");
    Response.Write("<script>window.parent.main.location.href='login.aspx';</script>");
    这个方法应该可以的