473,473 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Opening Multiple Windows

I am using the window.open function to open a small window and I am
using GET to get values back from that window. I want to be able to open
another from the second window but I get an error message when I try to
do another window.open. Any suggestions are welcomed.

Evan Kontos | EK*****@comtekcadd.com

27 Whitehall St. | 3rd Floor | New York, NY 10004
Tel 212.480.8166 | Fax 212.480.8167 | Personal Fax 786.513.0295
www.comtekcadd.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #1
7 3162
Hi Evan,

Did you mean to open a ie window in javascript or vbscript?
If so, how can you use the GET method to get values from an ie window in
client?
Can you post some code? So that I can narrow down the problem more quickly.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
From: Evan Kontos <ek*****@comtekcadd.com>
X-Newsreader: AspNNTP 1.50 (ActionJackson.com)
Subject: Opening Multiple Windows
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-ID: <#p**************@TK2MSFTNGP12.phx.gbl>
Newsgroups: microsoft.public.dotnet.general
Date: Tue, 02 Sep 2003 15:05:16 -0700
NNTP-Posting-Host: actionjackson133.dsl.frii.net 216.17.147.133
Lines: 1
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP12.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:107010
X-Tomcat-NG: microsoft.public.dotnet.general

I am using the window.open function to open a small window and I am
using GET to get values back from that window. I want to be able to open
another from the second window but I get an error message when I try to
do another window.open. Any suggestions are welcomed.

Evan Kontos | EK*****@comtekcadd.com

27 Whitehall St. | 3rd Floor | New York, NY 10004
Tel 212.480.8166 | Fax 212.480.8167 | Personal Fax 786.513.0295
www.comtekcadd.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Jul 19 '05 #2

Here is the code from the button click from the first form to open the
second form.

Private Sub BTNSlctMvFrm_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BTNSlctMvFrm.Click

Dim str As String = "<script language
=javascript>{window.open('userselectionform.aspx?f ormname1=Form1.TBXMvFr
mRm&formname2=Form1.TBXMvFrmFlr&formname3=Form1.TB XMvFrmBldg&formname4=F
orm1.TBXMvFrmSt&formname5=Form1.TBXMvFrmLNm&formna me6=Form1.TBXMvFrmFNm'
,"

str += " 'UserSelection','menubar=no,resizable=no,
toolbar=no,scrollbars=no,top=100,left=300,height=4 00,width=300');}</scri
pt>"

RegisterStartupScript("adf", str)

End Sub
Here is the code from the button click on the second form to close it
and post the info back to fields on the first.

Private Sub BtnCnfmMv_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BtnCnfmMv.Click

Try
Dim Str As String = "<script language=""javascript"">"

Str = Str & "window.opener." &
HttpContext.Current.Request.QueryString("formname1 ") & ".value = '" &
DDLRm.SelectedValue & "';"
Str = Str & "window.opener." &
HttpContext.Current.Request.QueryString("formname2 ") & ".value = '" &
DDLFlr.SelectedValue & "';"
Str = Str & "window.opener." &
HttpContext.Current.Request.QueryString("formname3 ") & ".value = '" &
DDLBldg.SelectedValue & "';"
Str = Str & "window.opener." &
HttpContext.Current.Request.QueryString("formname4 ") & ".value = '" &
DDLSite.SelectedValue & "';"
Str = Str & "window.opener." &
HttpContext.Current.Request.QueryString("formname5 ") & ".value = '" &
Trim(DDLMvNm.SelectedValue.Substring(0,
DDLMvNm.SelectedValue.IndexOf(","))) & "';"
Str = Str & "window.opener." &
HttpContext.Current.Request.QueryString("formname6 ") & ".value = '" &
Trim(DDLMvNm.SelectedValue.Substring(DDLMvNm.Selec tedValue.IndexOf(",")
+ 2)) & "';window.close();"
Str = Str & "</script>"
LiteralRm.Text = Str
Catch ex As Exception
Response.Write(ex.Message)
End Try
End Sub

I want to be able to open ANOTHER window from the second window, if
nothing more than to place a graphic box on it and show a graphic. Help
please.
Evan Kontos | EK*****@comtekcadd.com

27 Whitehall St. | 3rd Floor | New York, NY 10004
Tel 212.480.8166 | Fax 212.480.8167 | Personal Fax 786.513.0295
www.comtekcadd.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #3
Hi Evan,

I can not reproduce the problem. But I have written a demo as below.
[WebForm1.aspx.vb, add a button and textbox onto the WebForm1.aspx]
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim str As String = "<script language
=javascript>{window.opener.Form1.TextBox1.value
='hello';window.close();window.open('http://www.google.com');}</script>"
RegisterStartupScript("a", str)

End Sub
[WebForm2.aspx.vb add a button onto the WebForm2.aspx]
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim str As String = "<script language
=javascript>{window.open('http://localhost/WebApplication4/WebForm2.aspx');}
</script>"
RegisterStartupScript("adf", Str)
End Sub

You may have a test and let me know if it does the job for you.
Did I misunderstand your meaning?
If you have any related question please feel free to let me know.
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
From: Evan Kontos <ek*****@comtekcadd.com>
References: <Jq**************@cpmsftngxa06.phx.gbl>
X-Newsreader: AspNNTP 1.50 (ActionJackson.com)
Subject: RE: Opening Multiple Windows
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-ID: <e6**************@TK2MSFTNGP10.phx.gbl>
Newsgroups: microsoft.public.dotnet.general
Date: Wed, 03 Sep 2003 05:45:34 -0700
NNTP-Posting-Host: actionjackson133.dsl.frii.net 216.17.147.133
Lines: 1
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:107075
X-Tomcat-NG: microsoft.public.dotnet.general
Here is the code from the button click from the first form to open the
second form.

Private Sub BTNSlctMvFrm_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BTNSlctMvFrm.Click

Dim str As String = "<script language
=javascript>{window.open('userselectionform.aspx? formname1=Form1.TBXMvFr
mRm&formname2=Form1.TBXMvFrmFlr&formname3=Form1.T BXMvFrmBldg&formname4=F
orm1.TBXMvFrmSt&formname5=Form1.TBXMvFrmLNm&formn ame6=Form1.TBXMvFrmFNm'
,"

str += " 'UserSelection','menubar=no,resizable=no,
toolbar=no,scrollbars=no,top=100,left=300,height= 400,width=300');}</scri
pt>"

RegisterStartupScript("adf", str)

End Sub
Here is the code from the button click on the second form to close it
and post the info back to fields on the first.

Private Sub BtnCnfmMv_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BtnCnfmMv.Click

Try
Dim Str As String = "<script language=""javascript"">"

Str = Str & "window.opener." &
HttpContext.Current.Request.QueryString("formname 1") & ".value = '" &
DDLRm.SelectedValue & "';"
Str = Str & "window.opener." &
HttpContext.Current.Request.QueryString("formname 2") & ".value = '" &
DDLFlr.SelectedValue & "';"
Str = Str & "window.opener." &
HttpContext.Current.Request.QueryString("formname 3") & ".value = '" &
DDLBldg.SelectedValue & "';"
Str = Str & "window.opener." &
HttpContext.Current.Request.QueryString("formname 4") & ".value = '" &
DDLSite.SelectedValue & "';"
Str = Str & "window.opener." &
HttpContext.Current.Request.QueryString("formname 5") & ".value = '" &
Trim(DDLMvNm.SelectedValue.Substring(0,
DDLMvNm.SelectedValue.IndexOf(","))) & "';"
Str = Str & "window.opener." &
HttpContext.Current.Request.QueryString("formname 6") & ".value = '" &
Trim(DDLMvNm.SelectedValue.Substring(DDLMvNm.Sele ctedValue.IndexOf(",")
+ 2)) & "';window.close();"
Str = Str & "</script>"
LiteralRm.Text = Str
Catch ex As Exception
Response.Write(ex.Message)
End Try
End Sub

I want to be able to open ANOTHER window from the second window, if
nothing more than to place a graphic box on it and show a graphic. Help
please.
Evan Kontos | EK*****@comtekcadd.com

27 Whitehall St. | 3rd Floor | New York, NY 10004
Tel 212.480.8166 | Fax 212.480.8167 | Personal Fax 786.513.0295
www.comtekcadd.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Jul 19 '05 #4
Peter,

Let's make this simple. I want to be able to window.open from one form
to another and then window.open from the second web form to a third. I
want to then be able to close the third form and pass data from the
second form back to the first.
Evan Kontos | EK*****@comtekcadd.com

27 Whitehall St. | 3rd Floor | New York, NY 10004
Tel 212.480.8166 | Fax 212.480.8167 | Personal Fax 786.513.0295
www.comtekcadd.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #5
Hi Evan,

Provided there are three forms, A, B and C, each one have textbox and a
button on it.(ButtonA TextBoxA on form A,ButtonB TextBoxB on form B,ButtonC
TextBoxC on form C)

Click ButtonA will open form B, click ButtonB will open formC, input some
text into textBoxC and click the ButtonC will put back the text into
textBoxB and close form C.
click ButtonB will put back the text in TextBoxB into TextBoxA and close
FormB.

or

Provided there are three forms, A, B and C, ButtonA TextBoxA on form
A,ButtonB1 ButtonB2 TextBoxB on form B, TextBoxC on form C)

Click ButtonA will open form B, click ButtonB1 will open formC, input some
text into textBoxC and click the ButtonB2 will put back the text in
TextBoxC into textBoxB and close form C.
click ButtonB will put back the text in TextBoxB into TextBoxA and close
FormB.

Did I misunderstand your meaning?

If you are the latter case, when you use the window.open, the method will
return a reference to the new opened window which can be used to control
the new opened window.

string str = "<script language
=javascript>{window.opener.Form1.TextBox1.value ='hello';var o =
window.open('http://www.google.com');o.close();}</script>";
RegisterStartupScript("a", str);

the o in the code above is the reference to the new opened form. you may
used the reference to close the new opened one.

If you have any related question, please feel free to let me know.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
From: Evan Kontos <ek*****@comtekcadd.com>
References: <5F**************@cpmsftngxa06.phx.gbl>
X-Newsreader: AspNNTP 1.50 (ActionJackson.com)
Subject: RE: Opening Multiple Windows
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-ID: <#6**************@tk2msftngp13.phx.gbl>
Newsgroups: microsoft.public.dotnet.general
Date: Thu, 04 Sep 2003 08:13:52 -0700
NNTP-Posting-Host: actionjackson133.dsl.frii.net 216.17.147.133
Lines: 1
Path: cpmsftngxa06.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTN GXA05.phx.gbl!TK2MSFTNGP08
..phx.gbl!tk2msftngp13.phx.gblXref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:107285
X-Tomcat-NG: microsoft.public.dotnet.general

Peter,

Let's make this simple. I want to be able to window.open from one form
to another and then window.open from the second web form to a third. I
want to then be able to close the third form and pass data from the
second form back to the first.
Evan Kontos | EK*****@comtekcadd.com

27 Whitehall St. | 3rd Floor | New York, NY 10004
Tel 212.480.8166 | Fax 212.480.8167 | Personal Fax 786.513.0295
www.comtekcadd.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Jul 19 '05 #6
Peter,
Using the ABC's of forms, here goes. Form A has a textbox and button
to open form B. Form B has a textbox and button to open form c. Form C
has a graphic box and button to close the form and go back to form B.
Click on the button on form A to open form b. Select some data on form
b. Click on the button to open Form C and display a graphic w/the data
from Form B. Close Form B then close Form B passing the same data back
to the textbox on Form A. Is that clear?
Evan Kontos | EK*****@comtekcadd.com

27 Whitehall St. | 3rd Floor | New York, NY 10004
Tel 212.480.8166 | Fax 212.480.8167 | Personal Fax 786.513.0295
www.comtekcadd.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #7
Hi Evan,
from Form B. Close Form B then close Form B passing the same data back
to the textbox on Form A.
From the post, I do not know when you want to close the FormB,Since there
is only one button on the Formb and it is used to open FormC, so I think
perhaps you want to close the Form B and Form C after you have click the
button on FormC.
Anyway, if you want to pass the data to new opened window, you may use the
GET method to pass it in the QueryString HTTP server variable.
Here is my code. I assume that I have a textbox and a button on each Form.

[WebForm1.aspx.vb]
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim str As String = "<script language
=javascript>{window.open('http://localhost/WebApplication4/WebForm2.aspx');}
</script>"
RegisterStartupScript("adf", Str)
End Sub

[WebForm2.aspx.vb]
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim str As String = "<script language
=javascript>{window.open('http://localhost/WebApplication4/WebForm3.aspx?con
tent=" & TextBox1.Text & "');}</script>"
RegisterStartupScript("a", str)
End Sub

[WebForm3.aspx.vb]
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
TextBox1.Text = Request.QueryString("content")
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim str As String = "<script language
=javascript>{window.opener.opener.Form1.TextBox1.v alue ='" & TextBox1.Text
& "';window.close();window.opener.close();}</script>"
RegisterStartupScript("a", str)
End Sub
Did I misunderstand your question? If you have any related quesiton please
feel free to let me know.
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------From: Evan Kontos <ek*****@comtekcadd.com>
References: <Mq*************@cpmsftngxa06.phx.gbl>
X-Newsreader: AspNNTP 1.50 (ActionJackson.com)
Subject: RE: Opening Multiple Windows
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-ID: <#E**************@TK2MSFTNGP09.phx.gbl>
Newsgroups: microsoft.public.dotnet.general
Date: Fri, 05 Sep 2003 18:13:03 -0700
NNTP-Posting-Host: actionjackson133.dsl.frii.net 216.17.147.133
Lines: 1
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:107493
X-Tomcat-NG: microsoft.public.dotnet.general

Peter,
Using the ABC's of forms, here goes. Form A has a textbox and button
to open form B. Form B has a textbox and button to open form c. Form C
has a graphic box and button to close the form and go back to form B.
Click on the button on form A to open form b. Select some data on form
b. Click on the button to open Form C and display a graphic w/the data
from Form B. Close Form B then close Form B passing the same data back
to the textbox on Form A. Is that clear?
Evan Kontos | EK*****@comtekcadd.com

27 Whitehall St. | 3rd Floor | New York, NY 10004
Tel 212.480.8166 | Fax 212.480.8167 | Personal Fax 786.513.0295
www.comtekcadd.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Jul 21 '05 #8

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

Similar topics

8
by: ajay | last post by:
How to make a new page appear in tab instead of new window. I use Netscape 7+. Is there any provision to do in HTML language ? Ajay
1
by: SD Keane | last post by:
I have windows server 2003 installed at my end. IIS 6.0 got installed then. Then I installed visual studio .net and got a warning that exchange server 2000 does not work with IIS 6. But I...
14
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a...
4
by: Niranjan | last post by:
I have an Access XP split application operating on Windows XP. I have a form that opens on Startup that opens the backend database and keeps it open until the application is closed. For the first...
1
by: Alasdair | last post by:
Friends, I'm an old C programmer who upgraded to C++ but was never comfortable with it. I've recently moved to C# and love it but I obviously am missing some of the subtleties. I thought the...
2
by: Matt Hamilton | last post by:
I have an application page with a datagrid with a checkbox on each row. The user should check the rows they want to modify and then click a button. When the button is clicked, I have a Click...
11
by: Evan Kontos | last post by:
I am using the window.open function to open a small window and I am using GET to get values back from that window. I want to be able to open another from the second window but I get an error...
2
by: michael40card | last post by:
First of all... Hi I am attempting to create a html 'gallery creater' for a program... everythink was going ok, seems to work. the only trouble is i cannot find any way of allowing the user to...
8
by: paintedjazz | last post by:
I am using the following javascript to make a popup menu allow the user to navigate to different pages on a website. Yet it is opening windows as if I have <base target="some-name"> defined in the...
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
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.