public string OpenNew = "javascript:window.open('新页.aspx?id=变量','go',scrollbars=no,resizable=no,width=750,height=300')";那个变量我试了几种格式,一改整条代码就失效了
还有方法能设定打开新页的大小吗? 

解决方案 »

  1.   

    <SCRIPT LANGUAGE="javascript"> 
      <!-- 
      window.open ('page.html', 'newwindow', 'height=100, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no') //这句要写成一行
      --> 
      </SCRIPT>  
      
      参数解释: 
      
      <SCRIPT LANGUAGE="javascript"> js脚本开始; 
      window.open 弹出新窗口的命令; 
      'page.html' 弹出窗口的文件名; 
      'newwindow' 弹出窗口的名字(不是文件名),非必须,可用空''代替; 
      height=100 窗口高度; 
      width=400 窗口宽度; 
      top=0 窗口距离屏幕上方的象素值; 
      left=0 窗口距离屏幕左侧的象素值; 
      toolbar=no 是否显示工具栏,yes为显示; 
      menubar,scrollbars 表示菜单栏和滚动栏。 
      resizable=no 是否允许改变窗口大小,yes为允许; 
      location=no 是否显示地址栏,yes为允许; 
      status=no 是否显示状态栏内的信息(通常是文件已经打开),yes为允许; 
      </SCRIPT> js脚本结束
     
      

  2.   


    <script LANGUAGE="JavaScript">  
    <!--  
    function openwin() { window.open ("page.html", "newwindow", "height=100, width=400, toolbar=  
    no, menubar=no, scrollbars=no, resizable=no, location=no, status=no")  
    file://写/成一行  
    }  
    file://--/>  
    </script>  
      

  3.   

    window.open的定义和使用:http://www.w3schools.com/jsref/met_win_open.asp
      

  4.   

    public string OpenNew = "javascript:window.open('新页.aspx?id='+变量,'go',scrollbars=no,resizable=no,width=750,height=300')";
      

  5.   

    "javascript:window.open(\"新页.aspx?id=+"变量"+\",\"go\",\"scrollbars=no,resizable=no,width=750,height=300\")";
      

  6.   

    "javascript:window.open(\"新页.aspx?id=\"+变量+\",\"go\",\"scrollbars=no,resizable=no,width=750,height=300\")";
    这个试试