Response.Write("<SCRIPT>window.open ('https://www.tenpay.com/cgi-bin/med/show_opentrans.cgi?attach='"+cwt.Attach+"'&chnid='"+cwt.Chnid+"'&cmdno=12&encode_type=1&mch_desc='"+cwt.Mch_desc+"'&mch_name='"+cwt.Mch_name+"'&mch_price='"+cwt.Mch_price.ToString()+"'&mch_returl=http://10.1.46.133/tenpay_med_aspx/paynotify.aspx&mch_type=1&mch_vno='"+cwt.Mch_vno+"'&need_buyerinfo=2&seller=88881491&show_url=http://10.1.46.133/tenpay_med_aspx/payshow.aspx&transport_desc=%b2%e2%ca%d4%ce%ef%c1%f7%d0%c5%cf%a2&transport_fee=1&version=2&sign=F0601A0E81EB52E700275C35412136EA','newwindow','height=100,width=400,top=0,left=0,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no')</SCRIPT>");为什么我这句话没有打开一个新的窗体啊?

解决方案 »

  1.   

    首先要肯定,是不是浏览器阻止了冒似写的也有点问题:attach='" + cwt.Attach + "',像这些地方的'单引号用的有点问题吧
      

  2.   

    Page.RegisterStartupScript("startup","<script language=\"javascript\">" + "window.open(\"https://www.tenpay.com/cgi-bin/med/show_opentrans.cgi?attach="+cwt.Attach+"&chnid="+cwt.Chnid+"&cmdno=12&encode_type=1&mch_desc="+cwt.Mch_desc+"&mch_name="+cwt.Mch_name+"&mch_price="+cwt.Mch_price.ToString()+"&mch_returl=http://10.1.46.133/tenpay_med_aspx/paynotify.aspx&mch_type=1&mch_vno="+cwt.Mch_vno+"&need_buyerinfo=2&seller=88881491&show_url=http://10.1.46.133/tenpay_med_aspx/payshow.aspx&transport_desc=%b2%e2%ca%d4%ce%ef%c1%f7%d0%c5%cf%a2&transport_fee=1&version=2&sign=F0601A0E81EB52E700275C35412136EA','newwindow','height=100,width=400,top=0,left=0,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no'"+ "</script>" );我这样写了还是不行啊?
      

  3.   


    先测试最简单的来确认问题在哪里,慢慢缩小范围:比如是否被浏览器阻止了Response.Write(" <SCRIPT>window.open ('https://www.tenpay.com/cgi-bin/med/show_opentrans.cgi?attach=','newwindow','height=100,width=400,top=0,left=0,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no') </SCRIPT>"); 
      

  4.   


    Response.Write(" <SCRIPT>window.open ('https://www.tenpay.com/cgi-bin/med/show_opentrans.cgi?attach=','newwindow') </SCRIPT>"); 你先试一试短一点的。
      

  5.   

    好家伙,真复杂,建议简化一下操作,把长字符串写在一个string里