473,320 Members | 2,133 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,320 software developers and data experts.

How to send a pop up window from .vb file.

Hi there, please help on why this is happening:
I have tried to the following on my button click event, nothing is happening, no pop up new window. I could not think of anything wrong here.
'********
Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click

If CheckBalance() = 1 Then

Dim str As String = "<script language=""javascript"">" & _

" function openpopup(){ " & _

"winpops = window.open(""co2.aspx"", """", ""alwaysRaised,width=400,height=338,"")" & _

"} " & _

" openpopup();" & _

"</script>"

Response.Write(str)

End If

End Sub

'********
Nov 18 '05 #1
5 1243
Lily,

It's because nothing is calling the function when it's placed on the page.

Instead using response.write to place the script on the page try using
Page.RegisterStartUpScript instead.

If you'd like, I've created a Javascript component that can be placed on any
page and contains many useful javascripts for use in .Net, including a popup
window that can be attached to almost any .net object be it a button, drop
down, or whatever.

The component is free and you can download a help file for it and the full
source code. Just go to my site, www.aboutfortunate.com, click on the code
library link and then click on the Javascript button in the menu on the
left.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"Lily" <lf***@mynycb.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi there, please help on why this is happening:
I have tried to the following on my button click event, nothing is
happening, no pop up new window. I could not think of anything wrong here.
'********
Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnCalculate.Click

If CheckBalance() = 1 Then

Dim str As String = "<script language=""javascript"">" & _

" function openpopup(){ " & _

"winpops = window.open(""co2.aspx"", """",
""alwaysRaised,width=400,height=338,"")" & _

"} " & _

" openpopup();" & _

"</script>"

Response.Write(str)

End If

End Sub

'********
Nov 18 '05 #2
Thanks a lot!
"S. Justin Gengo" <sj*****@aboutfortunate.com> wrote in message
news:u%****************@TK2MSFTNGP12.phx.gbl...
Lily,

It's because nothing is calling the function when it's placed on the page.

Instead using response.write to place the script on the page try using
Page.RegisterStartUpScript instead.

If you'd like, I've created a Javascript component that can be placed on any page and contains many useful javascripts for use in .Net, including a popup window that can be attached to almost any .net object be it a button, drop
down, or whatever.

The component is free and you can download a help file for it and the full
source code. Just go to my site, www.aboutfortunate.com, click on the code
library link and then click on the Javascript button in the menu on the
left.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"Lily" <lf***@mynycb.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi there, please help on why this is happening:
I have tried to the following on my button click event, nothing is
happening, no pop up new window. I could not think of anything wrong here. '********
Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnCalculate.Click

If CheckBalance() = 1 Then

Dim str As String = "<script language=""javascript"">" & _

" function openpopup(){ " & _

"winpops = window.open(""co2.aspx"", """",
""alwaysRaised,width=400,height=338,"")" & _

"} " & _

" openpopup();" & _

"</script>"

Response.Write(str)

End If

End Sub

'********

Nov 18 '05 #3
Thanks a lot!
"S. Justin Gengo" <sj*****@aboutfortunate.com> wrote in message
news:u%****************@TK2MSFTNGP12.phx.gbl...
Lily,

It's because nothing is calling the function when it's placed on the page.

Instead using response.write to place the script on the page try using
Page.RegisterStartUpScript instead.

If you'd like, I've created a Javascript component that can be placed on any page and contains many useful javascripts for use in .Net, including a popup window that can be attached to almost any .net object be it a button, drop
down, or whatever.

The component is free and you can download a help file for it and the full
source code. Just go to my site, www.aboutfortunate.com, click on the code
library link and then click on the Javascript button in the menu on the
left.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"Lily" <lf***@mynycb.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi there, please help on why this is happening:
I have tried to the following on my button click event, nothing is
happening, no pop up new window. I could not think of anything wrong here. '********
Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnCalculate.Click

If CheckBalance() = 1 Then

Dim str As String = "<script language=""javascript"">" & _

" function openpopup(){ " & _

"winpops = window.open(""co2.aspx"", """",
""alwaysRaised,width=400,height=338,"")" & _

"} " & _

" openpopup();" & _

"</script>"

Response.Write(str)

End If

End Sub

'********

Nov 18 '05 #4
Thanks a lot for responding with such a speed!

now pop up window is out, but it won't stay on top even through I userd
"alwaysRaised":
*************
If CheckBalance() = 1 Then

If Not Page.IsClientScriptBlockRegistered("PopUpWindowv10 ") Then

Dim msbHTML As New System.Text.StringBuilder()

msbHTML.Append("<script language=""javascript"">" & vbCrLf)

msbHTML.Append("window.open('co2.aspx', '',
'alwaysRaised,width=400,height=338,')" & vbCrLf)

msbHTML.Append("</script>" & vbCrLf)

Page.RegisterClientScriptBlock("PopUpWindowv10", msbHTML.ToString)

End If

End If

************************************

"S. Justin Gengo" <sj*****@aboutfortunate.com> wrote in message
news:u%****************@TK2MSFTNGP12.phx.gbl...
Lily,

It's because nothing is calling the function when it's placed on the page.

Instead using response.write to place the script on the page try using
Page.RegisterStartUpScript instead.

If you'd like, I've created a Javascript component that can be placed on any page and contains many useful javascripts for use in .Net, including a popup window that can be attached to almost any .net object be it a button, drop
down, or whatever.

The component is free and you can download a help file for it and the full
source code. Just go to my site, www.aboutfortunate.com, click on the code
library link and then click on the Javascript button in the menu on the
left.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"Lily" <lf***@mynycb.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi there, please help on why this is happening:
I have tried to the following on my button click event, nothing is
happening, no pop up new window. I could not think of anything wrong here. '********
Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnCalculate.Click

If CheckBalance() = 1 Then

Dim str As String = "<script language=""javascript"">" & _

" function openpopup(){ " & _

"winpops = window.open(""co2.aspx"", """",
""alwaysRaised,width=400,height=338,"")" & _

"} " & _

" openpopup();" & _

"</script>"

Response.Write(str)

End If

End Sub

'********

Nov 18 '05 #5
Ok, I got it.
I used window.alert instead of window.open to put pop up window stays on
top of all other windows.

Thanks.

"S. Justin Gengo" <sj*****@aboutfortunate.com> wrote in message
news:u%****************@TK2MSFTNGP12.phx.gbl...
Lily,

It's because nothing is calling the function when it's placed on the page.

Instead using response.write to place the script on the page try using
Page.RegisterStartUpScript instead.

If you'd like, I've created a Javascript component that can be placed on any page and contains many useful javascripts for use in .Net, including a popup window that can be attached to almost any .net object be it a button, drop
down, or whatever.

The component is free and you can download a help file for it and the full
source code. Just go to my site, www.aboutfortunate.com, click on the code
library link and then click on the Javascript button in the menu on the
left.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"Lily" <lf***@mynycb.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi there, please help on why this is happening:
I have tried to the following on my button click event, nothing is
happening, no pop up new window. I could not think of anything wrong here. '********
Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnCalculate.Click

If CheckBalance() = 1 Then

Dim str As String = "<script language=""javascript"">" & _

" function openpopup(){ " & _

"winpops = window.open(""co2.aspx"", """",
""alwaysRaised,width=400,height=338,"")" & _

"} " & _

" openpopup();" & _

"</script>"

Response.Write(str)

End If

End Sub

'********

Nov 18 '05 #6

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

Similar topics

9
by: Etienne Charland | last post by:
Hi, there is an application running on a remote desktop (under Citrix ICA, but the same problem applies for RDC or PC Anywhere). Now, I want to send keys to the remote application from a local app....
15
by: Steve Horrillo | last post by:
I can't figure out why this script won't insert the subject in the email and why can't I control the font and size being used? I'm not sure where to post this. Let me know where if this is OT. ...
0
by: CLarkou | last post by:
My program in Access (Office 97/2000/XP/2003) opens a database (MAIN MENU) with a listing of all databases in a directory. User selects what database wants to open, and program opens it. I am not...
1
by: GrantS | last post by:
I need to use a sendkeys key combination to automate the "accept files" that a remote user wants to send to me via Windows messenger. I am using automation to work with Windows Messenger client in...
7
by: Randel Bjorkquist | last post by:
First, I'm extremely new to C# and the Microsoft Visual Studio IDE. I am in the middle of writing a small web application that communicates to a database server and sends out email confirmations. ...
4
by: Franck Diastein | last post by:
Hi, I'm trying to send a file to the browser with Response.Write, and it works great. The problem (I guess...) is that the code that sends the file is in a class, and whan I load aspx file...
4
by: riteshjain82 | last post by:
Hi, Please go through this: I am having a file (default.asp) on which i am taking many details from a user before mailing it to someone. I have also provided the user with a facility of...
2
by: iloveprincess | last post by:
Hi, I'm developing windows application using VB.Net 2005. I would like to send 'save' message using 'SendMessage' API to the excel appication. I've already got a handle of the excel window with...
3
digicrowd
by: digicrowd | last post by:
http://bytes.com/images/howtos/applemail_sig_icon.jpg You can make your emails fancy in Mail.app by using Rich Text formatting or even included Stationery. But, a simple way to send your own HTML...
4
Claus Mygind
by: Claus Mygind | last post by:
I am working on a small page I want to use for myself at home. I am trying to load the name of a file along with it's path into and Ajax call but all I get is the file name. Here is the 4 attempts I...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.