|
-
Oct 29th, 2010, 07:55 AM
#1
Thread Starter
Addicted Member
Popup Blocker
Hi, I'm opening new window from Code Behind for that I'm using Code :
Dim newWin As String = ("<script language='javascript'>" + "window.open('msgstat.aspx' , 'Print', 'height=200, width=220, menubar=no, toolbar=no, scrollbars=no, resizable=no'); </script>")
ClientScript.RegisterStartupScript(Me.GetType(), "pop", newWin)
Now, how can I check from codebehind that Browser's Popup Blocker is enabled or Disabled and show such message.
-
Oct 29th, 2010, 08:08 AM
#2
Re: Popup Blocker
In the code behind you can't, because the code in the code behind is running on the web server. However I believe it's possible using javascript on the client side. Here's a google search that might help ya: http://www.google.com/search?q=javas...ient=firefox-a
-
Oct 29th, 2010, 08:33 AM
#3
Re: Popup Blocker
You can do yourself a favour by taking the popup out of the equation. Ask yourself, do you really need it? Can you not show the information in a different way?
Gary
-
Oct 29th, 2010, 09:32 AM
#4
Thread Starter
Addicted Member
Re: Popup Blocker
 Originally Posted by gep13
You can do yourself a favour by taking the popup out of the equation. Ask yourself, do you really need it? Can you not show the information in a different way?
Gary
Ya, I'm showing the tip to users to check if pop up is blocked. bt it would b better to find ourself and inform users.
-
Oct 29th, 2010, 09:37 AM
#5
Re: Popup Blocker
What I meant was, do you even need the popup at all? What is in that pop up window?
Gary
-
Oct 29th, 2010, 09:41 AM
#6
Thread Starter
Addicted Member
Re: Popup Blocker
Well thanx friends for ur help. I found beautiful solution .
I Created a jacascript file like :
function detectPopupBlocker() {
var myTest = window.open("about:blank","","directories=no,height=100,width=100,menubar=no,resizable=no,scrollbars =no,status=no,titlebar=no,top=0,location=no");
if (!myTest) {
alert("Kindly Enable Your Popup-Blocker");
} else {
myTest.close();
}
}
window.onload = detectPopupBlocker;
It has solved my problem. When Page Loads It checks it.
Thanx
-
Oct 29th, 2010, 09:44 AM
#7
Re: Popup Blocker
But what happens if JavaScript is not enabled on the client?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|