Gridview将选中的行数据返回到父页面
本文关键字:返回 数据 Gridview | 更新日期: 2023-09-27 18:09:07
我想获得选定的行gridview数据(这是在模态弹出)回到父页面填充字段。这是怎么做到的呢?谢谢你的帮助。
你可以用一种期望返回值的方式来调用模式弹出。
在模态弹出框中,您需要使用window.returnValue = <your value>
并关闭窗口。
最简单的方法可能是返回你所选择的记录的ID,如果你有一个记录,并从该ID中提取数据。
下面是一个简单的例子http://www.mindfiresolutions.com/Get-Return-value-from-ModalPopup-in-parent-page-329.php
从关闭时的窗口获取值
var returnParameter = window.showModalDialog(url, parameter);
传递值返回
window.returnValue = returnParameter; // the value which is return to the parent page
window.close();
也可以参考window。打开器以获取对父窗口的引用。我曾经写过一篇博文:
http://netpl.blogspot.com/2007/12/autocompleteextender-key-value-issue.html