Click here to Skip to main content
15,884,998 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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);
Posted
Comments
CHill60 24-Dec-15 7:25am    
Accept the fact that some people like to block pop-ups in their browser - respect the settings.
Ashutosh shukla207 25-Dec-15 1:57am    
is there any solution to open the popup , if browser setting is against ?
CHill60 26-Dec-15 7:27am    
Not that I know of. That's the point of the user being able to block them
Ashutosh shukla207 27-Dec-15 2:07am    
okay ... thanks a ton for your views

1 solution

Hello Ashutosh,

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

Regards,
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900