开发者

gridview selected row data back to the parent page

开发者 https://www.devze.com 2023-04-06 03:34 出处:网络
I would like to get the selected row gridview data(which is in modal popup) back to the Pare开发者_StackOverflow社区nt page to populate the fields. How could this be done? I appreciate any help.You ca

I would like to get the selected row gridview data(which is in modal popup) back to the Pare开发者_StackOverflow社区nt page to populate the fields. How could this be done? I appreciate any help.


You can call the modal popup in a way that expects a return value.

Inside the modal popup you'll want to use window.returnValue = <your value> and close the window.

The simplest thing to probably do is to pass back the ID of the record you selected if you have one and pull the data from that ID.

Here is a simple example http://www.mindfiresolutions.com/Get-Return-value-from-ModalPopup-in-parent-page-329.php

Get the value from the window on close.

var returnParameter = window.showModalDialog(url, parameter);

Pass the value back

window.returnValue = returnParameter; // the value which is return to the parent page
window.close();


You can also refer to window.opener to get the reference to the parent window. I've blogged on this once:

http://netpl.blogspot.com/2007/12/autocompleteextender-key-value-issue.html

0

精彩评论

暂无评论...
验证码 换一张
取 消