原文网址:https://www.xuebuyuan.com/499352.html
pay.aspx
<script language="JavaScript" type="text/javascript"> function selectContract(id){ var form = document.form1; form.elements("txtcontractid").value = id==undefined?"":id; } </script>
<table> <tr> <td>采购合同编号:<span class="starred">*</span></td> <td colspan="3"><span class="editTab"><input name="txtcontractid" id="txtcontractid" value="" type="text" class="TEXT" size="30" maxlength="64" readonly="true"/></span> <input class="button" type="button" onclick='javascript:OW("contractlist.aspx","");' value="选择采购合同编号"/></td> </tr> </table>
contractlist.aspx中双击数据行,把数据行的值传回pay.aspx
<script language="javascript" type="text/javascript"> function doCheck(id) { if(window.opener && window.opener.selectContract) { opener.selectContract(id); window.close(); } } </script>
<asp:Repeater ID="Repeater1" runat="server" > <ItemTemplate> <tr ondblclick="doCheck('<%# Eval("ID")%>')"> <td ><%# Eval("ID")%></td> </tr> </ItemTemplate> </asp:Repeater>