How can I Check if the client Browser has a popup blocker turned on via C# ?
I tried to open an popup like this
ClientScript.RegisterStartupScript(this.GetType(), "newWindow", String.Format("<script>window.open('{0}', 'Cliente', 'toolbar=no,directories=no,status=no,menubar=no, scrollbars=yes,resizable=no', '720', '600', 'true'); </script>", url));
But i need to open a Alert if the browser have a popup blocker
How can I do that ?
You can do something like this:
Note: Did not test whether it compiles or not, but that’s the general idea.
See this other similar question
EDIT – adding test:
Produces:
I don’t see anything wrong with that. Now, my suggestion is that you remove the
<script></script>tags and let RegisterStarupScript add them by passingtrueas the last parameter as so: