473,385 Members | 1,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Creating popups

Help! I’m trying to get popups to work in asp.net. I’m Using the following
javascript code in a sub, but I can’t get the PopupWindow to work. At
first I thought the routine wasn’t working but it is. It looks like it’s the
window.open that’s not working. I have site popup allowed turned on, if I
replace window.open with alert it works, if I put the code in the html code
it works. Any suggestions?

Dim PopupScript As String = "<script language='javascript'>" & _
"window.open('popup.aspx', 'CustomPopUp', " & _
"'height=550, width=550, menubar=no, resizable=no');" & _
"</script>"
Me.RegisterStartupScript("PopupScript", PopupScript)

Jul 21 '05 #1
2 1684
try this code ............

--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP

<html>
<head>
<script language="VB" runat="server">

Sub Page_Load( sender as Object,e as EventArgs)

'Form the script that is to be registered at client side.
Dim scriptString as String = "<script language=JavaScript> function
DoClick() {"
ScriptString +=
"window.open('http://www.mvps.org','MyWindow','width=500,height=500');} <"
scriptString += "/"
scriptString += "script>"

If(Not IsClientScriptBlockRegistered("clientScript"))
RegisterClientScriptBlock("clientScript", scriptString)
End If
End Sub
</script>
</head>
<body topmargin="20" leftmargin="10">
<form id="myForm" runat="server">

<INPUT id="launchButton" onclick="DoClick();" type="button"
value="Submit" name="myButton" runat="server">

</form>
</body>
</html>

"Logger" <Lo****@discussions.microsoft.com> wrote in message
news:C4**********************************@microsof t.com...
Help! I'm trying to get popups to work in asp.net. I'm Using the following javascript code in a sub, but I can't get the PopupWindow to work. At
first I thought the routine wasn't working but it is. It looks like it's the window.open that's not working. I have site popup allowed turned on, if I
replace window.open with alert it works, if I put the code in the html code it works. Any suggestions?

Dim PopupScript As String = "<script language='javascript'>" & _
"window.open('popup.aspx', 'CustomPopUp', " & _
"'height=550, width=550, menubar=no, resizable=no');" & _
"</script>"
Me.RegisterStartupScript("PopupScript", PopupScript)

Jul 21 '05 #2
Also, make sure popup blockers are disabled. They might interfere with this
code.

"John Timney (Microsoft MVP)" <ti*****@despammed.com> wrote in message
news:O1*************@TK2MSFTNGP11.phx.gbl...
try this code ............

--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP

<html>
<head>
<script language="VB" runat="server">

Sub Page_Load( sender as Object,e as EventArgs)

'Form the script that is to be registered at client side.
Dim scriptString as String = "<script language=JavaScript> function
DoClick() {"
ScriptString +=
"window.open('http://www.mvps.org','MyWindow','width=500,height=500');} <"
scriptString += "/"
scriptString += "script>"

If(Not IsClientScriptBlockRegistered("clientScript"))
RegisterClientScriptBlock("clientScript", scriptString)
End If
End Sub
</script>
</head>
<body topmargin="20" leftmargin="10">
<form id="myForm" runat="server">

<INPUT id="launchButton" onclick="DoClick();" type="button"
value="Submit" name="myButton" runat="server">

</form>
</body>
</html>

"Logger" <Lo****@discussions.microsoft.com> wrote in message
news:C4**********************************@microsof t.com...
Help! I'm trying to get popups to work in asp.net. I'm Using the

following
javascript code in a sub, but I can't get the PopupWindow to work. At
first I thought the routine wasn't working but it is. It looks like it's

the
window.open that's not working. I have site popup allowed turned on, if I
replace window.open with alert it works, if I put the code in the html

code
it works. Any suggestions?

Dim PopupScript As String = "<script language='javascript'>" & _
"window.open('popup.aspx', 'CustomPopUp', " & _
"'height=550, width=550, menubar=no, resizable=no');" & _
"</script>"
Me.RegisterStartupScript("PopupScript", PopupScript)


Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Art | last post by:
NEWBIE ALERT! Esteemed List Participants and Lurkers: (System: P-II 350, 192 meg, Win98 SE, Python 2.2.3, wxPythonWIN32-2.4.1.2-Py22.exe) I'm having a lot of fun getting started with Python...
52
by: Harlan Messinger | last post by:
Can you help me figure out what to do about popups? Sometimes we develop web applications where popups make very good sense for precisely the same reasons they make sense in traditional...
1
by: Logger | last post by:
Help! I’m trying to get popups to work in asp.net. I’m Using the following javascript code in a sub, but I can’t get the PopupWindow to work. At first I thought the routine wasn’t...
3
by: PSERVE | last post by:
Is the a way of preventing popups from other sites while your page is loading? -- Regards Nik http://www.itconsultancy.org
2
by: Tom Szabo | last post by:
Hi, >>IE in Windows XP Service Pack 2 has a popup blocker that blocks unsolicited >>popups >>IE (other than Windows XP Service Pack 2) also has many add-ons (Google toolbar, >>Yahoo! toolbar,...
24
by: jonathon | last post by:
Hi all, I have a web app with a popup window for entering data. I don't want to access the web every time this window is opened, as most of the app is AJAX. But I can't figure out how to open...
4
by: ciprian.dosoftei | last post by:
Hello, I just finished a tutorial website regarding the development of DHTML popups. The site features several examples with downloadable samples. It also feature more complex effects like...
1
by: YotamElal | last post by:
Hello, I have a popup problem. When a popup is opened, I want all other popups to close immediatly. (except for its self and it's child popups) Here is my code: code: <!DOCTYPE HTML PUBLIC...
1
by: Moe Sisko | last post by:
Using : ASP.NET 2.0, IE 7. This is a strange problem with popups not working in IE to remote sites, even though popups are allowed in IE. To reproduce, create web site with two pages,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.