gridview selected row data back to the parent page
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
精彩评论