window.open的浏览器问题 [英] Browser Issues with window.open

查看:245
本文介绍了window.open的浏览器问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,



我在面对某些浏览器问题时,在按钮上点击后打开新标签已检查。

Hi friends,

I am facing some browser issue while opening the new tab on buttonclick after condition is checked.

protected void btnPrint_Click(object sender, EventArgs e)
{
    DataTable dt = ....;
    if (dt.Rows.Count != 0)
    {                
        string redirect = "<script>window.open('some other page');</script>";
        Response.Write(redirect);
    }
    else
    {
        this.ClientScript.RegisterStartupScript(this.GetType(), "Startupalert", "alert('No details to show');", true);
    }
}





因为它可以正常使用 Firefox IE 但不在 Chrome ...

可以请任何人给出一些建议????



as it is working fine with Firefox and IE but not in Chrome...
Can any one please give some suggestions????

推荐答案

window.open是javascript方法,支持所有主流浏览器(包括crome)。你看到w3school网站你会更清楚。

WINDOW OPEN [ ^ ]



我尝试使用你的代码并且它在我的网站上工作。



我猜你的crome浏览器的弹出窗口被禁止浏览器设置。如果您从浏览器启用弹出窗口,那么希望它能够正常工作。



更改crome浏览器弹出窗口设置

https://support.google.com/chrome/answer/95472?hl=en [ ^ ]
window.open is javascript method and all major browser (including crome) it is supported. It you see w3school site you will be more clear.
WINDOW OPEN[^]

I tried with your code and it is working in my site.

I guess from your crome browser's popup window is blocked from browser settings. If you enable popup from your browser then hopefully it will work.

for change crome browser popup window settings
https://support.google.com/chrome/answer/95472?hl=en[^]


这篇关于window.open的浏览器问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆