ShowModalDialog 传值

stone_soup 2006-08-23 04:46:09
父窗体:A.aspx :一TextBox 和
<a onclick='var op=window.showModalDialog("b.aspx")'>打開</a>

子窗体:B.aspx :
RadioButtonList 有五個項.其中:
Me.RadioButtonList1.SelectedItem.Text="123456"

请问怎样:在
父窗体:A.aspx :一TextBox设为:
Me.RadioButtonList1.SelectedItem.Text
...全文
181 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
stone_soup 2006-08-23
  • 打赏
  • 举报
回复
多謝諸位.結貼
cctaiyang 2006-08-23
  • 打赏
  • 举报
回复
fireForm.htm:点击“上传”按钮弹出内部窗口(showModalDialog),代码如下:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<script language="javascript">
function onObjMore(url,name,height,width,formName) {
//window.alert(formName.file.type);
var feature = "dialogWidth:"+width+"px;dialogHeight:"+height+"px;scroll:yes;status:no;help:no;center:1";
var returnTarget = window.showModalDialog(url, name, feature);
if(returnTarget != undefined && returnTarget.length > 1) {
//document.location = returnTarget;
formName.file.value=returnTarget;
}
return false;
}
</script>
<link href="css/aljoin.css" rel="stylesheet" type="text/css">
</head>

<body>
<form name="proForm" method="post" action="">
<table width="400" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="93" height="25" style="white-space:nowrap " nowrap>文件</td>
<td width="307" height="25"><input name="file" type="text" id="file"></td>
</tr>
<tr>
<td height="25"> </td>
<td height="25"><input type="button" name="Submit" value="上传文件" onClick="onObjMore('upfile.htm','upfile',300,300,proForm)"></td>
</tr>
</table>
</form>
</body>
</html>


upfile.htm:点击”关闭”按钮返回window.returnValue值给opener,代码如下:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<script language="javascript">
function exit() {
window.returnValue = "images/upload/2004080512.jpg";
window.close();
}
</script>
</head>
<body>
<input name="" type="button" value="关闭窗口" onClick="exit()">
</body>
</html>
xiedan79 2006-08-23
  • 打赏
  • 举报
回复
子窗体
window.returnValue = 你要返回的值;
window.close();

父窗体
var reValue = showModalDialog('....');
if(isNan(reValue))
{
....
}
else
{
....
}
cctaiyang 2006-08-23
  • 打赏
  • 举报
回复
window.dialogArguments.returnValue

62,041

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧