showmodaldialog问题 [英] showmodaldialog issues

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

问题描述

我正在玩showmodeldialog,并且子窗口没有返回

变量给父母


在父母我有


Button2.Attributes.Add(" onclick"," var strReturn;

strReturn = window.showModalDialog(''test.aspx'',null,''status :no; dialogWidth:370px; dialogHeight:220px; di alogHide:true; help:no; scroll:no''); if

(strReturn!= null)document.getElementById(''Label45' ')。value = strReturn;")

子窗口已经


Button1.Attributes.Add(" onclick"," window.returnValue =

document.getElementById(''TextBox1'')。value; window.close();")


如果我正确 - 它应该传递内容将TextBox1添加到父级和

父级应该将Label45显示为传递的返回变量 - 除了它确实没有?b $ b什么都没有?


i感觉就像我在某个地方的正确轨道!


干杯


马克

解决方案

马克,


代码看起来很好。问题可能出在其他地方。


Eliyahu


" luna" <卢** @ themoon.com>在消息中写道

新闻:lZ ******************* @ newsfe2-win.ntli.net ...

我正在玩showmodeldialog,并且子窗口不是
将变量返回给父母

在父母我有

Button2.Attributes.Add( " onclick"," var strReturn;
strReturn = window.showModalDialog(''test.aspx'',null,''status:no; dialogWidth:370px; dialogHeight:220px; di alogHide:true; help :no; scroll:no'');如果
(strReturn!= null)document.getElementById(''Label45'')。value = strReturn;")

子窗口有

Button1.Attributes.Add(" onclick"," window.returnValue =
document.getElementById(''TextBox1'')。value; window.close();" )

如果我正确 - 它应该将TextBox1的内容传递给父级,而
父级应该将Label45显示为传递回的变量 - 除了它没有什么?

我觉得我很喜欢在某个地方正确的轨道!

Mark



我不确定在哪里

两个attributes.add语句都在页面加载上,


child has< base target =" _self">介于< head>之间< / head>


否则弹出另一个窗口


我说的是变量应该出现在父母身上/>
点击了孩子的按钮?

" Eliyahu Goldin" <再************* @ monarchmed.com>在消息中写道

新闻:O1 ************** @ TK2MSFTNGP11.phx.gbl ...

Mark,
代码看起来很好。问题可能出在其他地方。

Eliyahu

露娜 <卢** @ themoon.com>在消息中写道
新闻:lZ ******************* @ newsfe2-win.ntli.net ...

即时通讯使用showmodeldialog,并且子窗口不是
将变量返回给父级

在父母我有

Button2.Attributes.Add(" onclick" ,var strReturn;
strReturn = window.showModalDialog(''test.aspx'',null,''status:no; dialogWidth:370px; dialogHeight:220px; di alogHide:true; help:no; scroll :no'');如果
(strReturn!= null)document.getElementById(''Label45'')。value = strReturn;")

子窗口有

Button1.Attributes.Add(" onclick"," window.returnValue =
document.getElementById(''TextBox1'')。value; window.close();")

如果我是正确的 - 它应该将TextBox1的内容传递给父级,而
父级应该将Label45显示为传递的返回变量 - 除了它没有什么?
我觉得我在钻井平台上ht track to somewhere!

Mark




Label45的类型是什么?


如果是asp:Label,它会呈现为< span>。要在客户端更改其文本

方面,您应该分配给


document.getElementById(''Label45'')。innerText

Eliyahu


" luna" <卢** @ themoon.com>在消息中写道

新闻:Gx **************** @ newsfe3-win.ntli.net ...

im不确定

两个attributes.add语句是否在页面加载上,

child has< base target =" _self">介于< head>之间< / head>

否则会弹出另一个窗口

我说的是,一旦我点击了孩子的按钮,该变量应该出现在父母身上?

" Eliyahu Goldin" <再************* @ monarchmed.com>在消息中写道
新闻:O1 ************** @ TK2MSFTNGP11.phx.gbl ...

Mark,
代码看起来很好。问题可能出在其他地方。

Eliyahu

露娜 <卢** @ themoon.com>在消息中写道
新闻:lZ ******************* @ newsfe2-win.ntli.net ...

即时通讯使用showmodeldialog,并且子窗口不是
将变量返回给父级

在父母我有

Button2.Attributes.Add(" onclick" ,var strReturn;
strReturn = window.showModalDialog(''test.aspx'',null,''status:no; dialogWidth:370px; dialogHeight:220px; di alogHide:true; help:no; scroll :no'');如果
(strReturn!= null)
document.getElementById(''Label45'')。value = strReturn;")

子窗口有

Button1.Attributes.Add(" onclick"," window.returnValue =
document.getElementById(''TextBox1'')。value; window.close();" )

如果我正确 - 它应该将TextBox1的内容传递给父级,并且
父级应该将Label45显示为传递的返回变量 - 除了它什么都不做?
我觉得我很喜欢他正好在某个地方跑道!

Mark




im playing around with showmodeldialog, and the child window isnt returning
the variable to the parent

in the parent i have

Button2.Attributes.Add("onclick", "var strReturn;
strReturn=window.showModalDialog(''test.aspx'',null, ''status:no;dialogWidth:370px;dialogHeight:220px;di alogHide:true;help:no;scroll:no'');if
(strReturn != null) document.getElementById(''Label45'').value=strReturn ;")
child window has

Button1.Attributes.Add("onclick", "window.returnValue =
document.getElementById(''TextBox1'').value; window.close();")

if im correct - it should pass contents of TextBox1 to the parent and the
parent should show Label45 as the passed back variable - except it does
nothing ?

i feel like im on the right track somewhere!

cheers

Mark

解决方案

Mark,

The code looks fine. The problem is likely somewhere else.

Eliyahu

"luna" <lu**@themoon.com> wrote in message
news:lZ*******************@newsfe2-win.ntli.net...

im playing around with showmodeldialog, and the child window isnt
returning the variable to the parent

in the parent i have

Button2.Attributes.Add("onclick", "var strReturn;
strReturn=window.showModalDialog(''test.aspx'',null, ''status:no;dialogWidth:370px;dialogHeight:220px;di alogHide:true;help:no;scroll:no'');if
(strReturn != null) document.getElementById(''Label45'').value=strReturn ;")
child window has

Button1.Attributes.Add("onclick", "window.returnValue =
document.getElementById(''TextBox1'').value; window.close();")

if im correct - it should pass contents of TextBox1 to the parent and the
parent should show Label45 as the passed back variable - except it does
nothing ?

i feel like im on the right track somewhere!

cheers

Mark



im not sure where
both attributes.add statements are on page load,

child has <base target="_self"> between <head> </head>

otherwise another window pops up

am i correct in saying the variable should appear on the parent once ive
clicked the button on the child ?
"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:O1**************@TK2MSFTNGP11.phx.gbl...

Mark,

The code looks fine. The problem is likely somewhere else.

Eliyahu

"luna" <lu**@themoon.com> wrote in message
news:lZ*******************@newsfe2-win.ntli.net...

im playing around with showmodeldialog, and the child window isnt
returning the variable to the parent

in the parent i have

Button2.Attributes.Add("onclick", "var strReturn;
strReturn=window.showModalDialog(''test.aspx'',null, ''status:no;dialogWidth:370px;dialogHeight:220px;di alogHide:true;help:no;scroll:no'');if
(strReturn != null) document.getElementById(''Label45'').value=strReturn ;")
child window has

Button1.Attributes.Add("onclick", "window.returnValue =
document.getElementById(''TextBox1'').value; window.close();")

if im correct - it should pass contents of TextBox1 to the parent and the
parent should show Label45 as the passed back variable - except it does
nothing ?

i feel like im on the right track somewhere!

cheers

Mark




What is the type of Label45?

If it is an asp:Label, it renders as a <span>. To change its text on client
side you should assign to

document.getElementById(''Label45'').innerText

Eliyahu

"luna" <lu**@themoon.com> wrote in message
news:Gx****************@newsfe3-win.ntli.net...

im not sure where
both attributes.add statements are on page load,

child has <base target="_self"> between <head> </head>

otherwise another window pops up

am i correct in saying the variable should appear on the parent once ive
clicked the button on the child ?
"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:O1**************@TK2MSFTNGP11.phx.gbl...

Mark,

The code looks fine. The problem is likely somewhere else.

Eliyahu

"luna" <lu**@themoon.com> wrote in message
news:lZ*******************@newsfe2-win.ntli.net...

im playing around with showmodeldialog, and the child window isnt
returning the variable to the parent

in the parent i have

Button2.Attributes.Add("onclick", "var strReturn;
strReturn=window.showModalDialog(''test.aspx'',null, ''status:no;dialogWidth:370px;dialogHeight:220px;di alogHide:true;help:no;scroll:no'');if
(strReturn != null)
document.getElementById(''Label45'').value=strReturn ;")
child window has

Button1.Attributes.Add("onclick", "window.returnValue =
document.getElementById(''TextBox1'').value; window.close();")

if im correct - it should pass contents of TextBox1 to the parent and
the parent should show Label45 as the passed back variable - except it
does nothing ?

i feel like im on the right track somewhere!

cheers

Mark





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

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