问题描述如下:
在 webform1中有一个text1和个button1. 点button1调出webform2.在webfrom2中用GridView显示资料(来自sql)。我想通过双击GirdView中的某行把所选取选的行的某列的值传回给调用webform2的text1.text属性.
请问 双击事件和传值 怎么实现??
在 webform1中有一个text1和个button1. 点button1调出webform2.在webfrom2中用GridView显示资料(来自sql)。我想通过双击GirdView中的某行把所选取选的行的某列的值传回给调用webform2的text1.text属性.
请问 双击事件和传值 怎么实现??
<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>
你需要查看运行后的你的aspx页面源码,
找到你的服务器文本框控件的客户端ID号,
替换掉上面相应的控件就可以了