如何在c#中打开浏览器窗口而不被浏览器阻止

如何在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,