Response.Redirect可以用;Page.RegisterStartupScript为什么就有问题》?
Response.Redirect(sURL);
/*Page.RegisterStartupScript( " ", " <script language= 'javascript '> "
+ "window.open( ' " + sURL + " ', 'win ', 'width= " + iWidth + ",height= " + iHeight + ",top=0,left=0 '); "
+ " </script> ");
---------
sURL是个相对路径
用Response.Redirect(sURL);没有错误
用Page.RegisterStartupScript的话就出错,错误信息如下:
鈥?troa0122鈥濆簲鐢ㄧ▼搴忎腑鐨勬湇鍔″櫒閿欒銆?hr width=100% size=1 color=silver>
HTTP 閿欒 400 - Bad Request銆?/i>
以前用Page.RegisterStartupScript都好好的,今天就只改了window.open的width和height就出问题了,改回原来的也用不了了。
请问怎么解决啊?
------解决方案--------------------这肯定不是Page.RegisterStartupScript的问题吧
------解决方案--------------------检查一下客户端的javascript脚本就很清楚了
------解决方案--------------------貌似编码问题
这样可以吗?
Response.write( " <script language= 'javascript '> "
+ "window.open( ' " + sURL + " ', 'win ', 'width= " + iWidth + ",height= " + iHeight + ",top=0,left=0 '); ");
------解决方案--------------------可能是拼接脚本出错了,引号、逗号或分号引起的!