string script=@"
<script>
w=window.open('aa.html','a','')
w.focus();
</script>";Response.Write(script);这样写试试!

解决方案 »

  1.   

    我改成vb的了
        dim script as string
             script=@"
             <script>
             w=window.open('aa.html','hh','top=20,left=100,width=200,height=200')
             w.focus()
        
        </"+"script>"
        
        
        Response.Write(script)不过出错了编译错误 
    说明: 在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。 编译器错误信息: BC30188: 需要声明。源错误: 行 3:  
    行 4:      dim script as string
    行 5:           script=@"
    行 6:           <script>
    行 7:           w=window.open('aa.html','hh','top=20,left=100,width=200,height=200')
     
      

  2.   

    dim scriptstr as string
             scriptstr="<script>" + vbcrlf
             scriptstr=scriptstr+"window.open'aa.html','hh','top=20,left=100,width=200,height=200')"+vbcrlf
             scriptstr=scriptstr+"w.focus()"
            scriptstr=scriptstr+"</script>"
        
        
        Response.Write(scriptstr)
      

  3.   

    这样写:...
    Response.write "<script>" & vbCrLf
    Response.write "w=window.open('aa.html','a','')" & vbCrLF
    Response.write "w.focus" & vbCrLF
    Response.write "</script>" & vbCrLF
    ...试一试
      

  4.   

    //language=c#
    Response.Write ("<script> w=window.open('aa.html','a','');w.focus();</"+"script>");
      

  5.   

    <script> 和 </script> 必须折分
    因为代码中<% %>还有一种表示法是:<script runat=server>
     //code here
    </script>
      

  6.   

    Response.Write("<script>w=window.open('aa.html','a','')
    w.focus();
    </script>");
      

  7.   

    同意 mummy_zc(水煮鱼) ( )  
     
      //language=c#
    Response.Write ("<script> w=window.open('aa.html','a','');w.focus();</"+"script>");
    还有,我的("<script> 就从不拆分的,没有遇到过什么问题