首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

window.open有关问题

2012-03-02 
window.open问题string ImgPath((System.Web.UI.WebControls.Image)e.Item.FindControl(Image2)).Image

window.open问题
string ImgPath=((System.Web.UI.WebControls.Image)e.Item.FindControl("Image2")).ImageUrl; 
string url=@"http://localhost/MCD/"+ImgPath; 
Response.Redirect(url); 
这样可以定向到一个显示图片的页面, 
换成Response.Write("<script>window.open('"+url+"')</script>"); 
虽然可以弹出新页面,但不能显示图片,而且地址栏有乱码: 
http://localhost/MCD/Image.jpg 
http://localhost/MCD/Image.jpg 

找不到网页 
正在查找的网页可能已被删除、重命名或暂时不可用。 

怎么回事呢?

[解决办法]
Response.Write(" <script>window.open('ImgPath') </script>"); 把url换成ImgPath

热点排行