如何在c#中打开浏览器窗口而不被浏览器阻止 [英] how to open a browser window in c# without being blocked by browser

查看:91
本文介绍了如何在c#中打开浏览器窗口而不被浏览器阻止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友......我正在开发Web应用程序,我需要从后面的代码打开一个浏览器窗口。但浏览器总是阻止新的弹出窗口。



我打开一个新窗口的过程如下......其实际工作..但弹出窗口始终被浏览器阻止。我该怎么办?





ScriptManager.RegisterStartupScript(Page,typeof(Page)," OpenWindow"," var redirectWindow = window.open(' " + call_on_action.ToString()。Trim()+ Session [" sid"]。ToString()。Trim()+"','_ blank'); redirectWindow.location;",true);

hello friends ... im working on web application, and i need to open a browser window from code behind. but browser always block the new popup window .

my process to open a new window is below...its working actually.. but popup always being blocked by browser. what should i do?


ScriptManager.RegisterStartupScript(Page, typeof(Page), "OpenWindow", "var redirectWindow = window.open('" + call_on_action.ToString().Trim() + Session["sid"].ToString().Trim() + "','_blank');redirectWindow.location;", true);

推荐答案

你好Ashutosh,



请查看 this [ ^ ] StackOverflow线程。我完全同意 CHill60的建议&也会推荐相同的。



问候,
Hello Ashutosh,

Please have a look at this[^] StackOverflow thread. I Completely Agree with CHill60's recommendation & will also recommend the same.

Regards,


这篇关于如何在c#中打开浏览器窗口而不被浏览器阻止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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