打开多个Windows [英] Opening Multiple Windows

查看:52
本文介绍了打开多个Windows的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用window.open函数打开一个小窗口,我使用GET来从该窗口获取值。我希望能够从第二个窗口打开另一个
,但是当我尝试

做另一个window.open时,我收到一条错误消息。欢迎任何建议。


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

27 Whitehall St. | 3楼|纽约,纽约10004

电话212.480.8166 |传真212.480.8167 |个人传真786.513.0295
www.comtekcadd.com


***通过开发人员指南 http://www.developersdex.com ***

不要只是参加USENET ......获得奖励!

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!

推荐答案

你好Evan,


你的意思是在javascript或vbscript中打开一个ie窗口吗?

如果是这样的话,你如何使用GET方法从中获取值即窗口在

客户端?

你能发布一些代码吗?因此,我可以更快地缩小问题范围。


问候,

Peter Huang

Microsoft在线合作伙伴支持
安全!
www.microsoft.com/security

此帖子是提供按原样没有保证,也没有赋予任何权利。

--------------------
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.
--------------------
来自:Evan Kontos< ek*****@comtekcadd.com>
X-Newsreader:AspNNTP 1.50(ActionJackson.com)
主题:打开多个Windows
Mime版本:1.0
内容 - 输入:text / plain; charset =" us-ascii"
Content-Transfer-Encoding:7bit
消息ID:< #p ************** @ TK2MSFTNGP12.phx。 gbl>
新闻组:microsoft.public.dotnet.general
日期:2003年9月2日星期二15:05:16 -0700
NNTP-Posting-Host:actionjackson133.dsl.frii.net 216.17.147.133
行:1
路径:cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP12.phx.gbl
外部参照:cpmsftngxa06.phx.gbl microsoft.public.dotnet .general:107010
X-Tomcat-NG:microsoft.public.dotnet.general

我正在使用window.open函数打开一个小窗口我正在使用
获取从该窗口返回值。我希望能够从第二个窗口打开另一个窗口,但是当我尝试执行另一个窗口时,我收到一条错误消息。打开。欢迎任何建议。

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

27 Whitehall St. | 3楼|纽约,纽约10004
电话212.480.8166 |传真212.480.8167 |个人传真786.513.0295
www.comtekcadd.com

***通过开发人员指南 http://www.developersdex.com 发送***
不要只是参加USENET ......获得奖励!
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!








以下是从第一个表单中单击按钮以打开

第二个表单的代码。


Private Sub BTNSlctMvFrm_Click(ByVal sender As System.Object, ByVal e As

System.EventArgs)处理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

这是从第二个表单上点击按钮的代码关闭它

并将信息发回第一个字段。


Private Sub BtnCnfmMv_Click(ByVal sender As System.Object,ByVal e As

System.EventArgs)处理BtnCnfmMv.Click


尝试

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 =''" &

修剪(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)

结束尝试

结束子


我希望能够从第二个窗口打开另一个窗口,如果

只是在其上放置一个图形框并显示图形。帮助

拜托。

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

27 Whitehall St. | 3楼|纽约,纽约10004

电话212.480.8166 |传真212.480.8167 |个人传真786.513.0295
www.comtekcadd.com


***通过开发人员指南 http://www.developersdex.com ***

不要只是参加USENET ......获得奖励!

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!


嗨Evan,


我无法重现这个问题。但是我写了一个如下的演示。

[WebForm1.aspx.vb,在WebForm1.aspx上添加一个按钮和文本框]

Private Sub Button1_Click(ByVal sender As System.Object,ByVal e As

System.EventArgs)处理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在WebForm2.aspx上添加一个按钮]

Private Sub Button1_Click(ByVal sender As System.Object,ByVal e As

System .EventArgs)处理Button1.Click

Dim str As String ="< script language

= javascript> {window.open(''http:// localhost / WebApplication4 / WebForm2.aspx'');}

< / script>"

RegisterStartupScript(" adf" ;,Str)

结束子


您可能有测试并告诉我它是否适合您。

我是否误解了你的意思?

如果您有任何相关问题,请随时告诉我。

问候,

Peter Huang

Microsoft在线合作伙伴支持

安全!
www.microsoft.com/security

此帖子是提供按原样没有保证,也没有赋予任何权利。

--------------------
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.
--------------------
来自:Evan Kontos< ek*****@comtekcadd.com>
参考文献:< Jq ************** @ cpmsftngxa06.phx.gbl>
X-Newsreader:AspNNTP 1.50(ActionJackson.com)
主题:RE:打开多个窗口
Mime版本:1.0
内容类型:text / plain; charset =" us-ascii"
Content-Transfer-Encoding:7bit
消息ID:< e6 ************** @ TK2MSFTNGP10.phx.gbl> ;
新闻组:microsoft.public.dotnet.general
日期:2003年9月3日星期三05:45:34 -0700
NNTP-Posting-Host:actionjackson133.dsl.frii.net 216.17 .147.133
行:1
路径:cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
外部参照:cpmsftngxa06.phx.gbl microsoft.public.dotnet。一般:107075
X-Tomcat-NG:microsoft.public.dotnet.general

这是从第一个表单点击按钮的代码,打开
第二个表单。

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

Dim str As String ="< ;脚本语言
= javascript> {window.open(''userselectionform.aspx?formname1 = Form1.TBXMvFr
mRm& formname2 = Form1.TBXMvFrmFlr& formname3 = Form1.T BXMvFrmBldg& formname4 = F
orm1.TBXMvFrmSt&for mname5 = 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

这是来自的代码按钮单击第二个表单关闭它
并将信息发回第一个字段。

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

尝试
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 Sub

我希望能够从第二个窗口打开另一个窗口,如果只是在其上放置一个图形框并显示图形。帮助
请。

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

27 Whitehall St. | 3楼|纽约,纽约10004
电话212.480.8166 |传真212.480.8167 |个人传真786.513.0295
www.comtekcadd.com

***通过开发人员指南 http://www.developersdex.com 发送***
不要只是参加USENET ......获得奖励!
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!






这篇关于打开多个Windows的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆