Posting data back to a modal dialog window

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi all,

I have a modal dialog window from which a user selects a few rows from a
datagrid and then clicks on an image button. My question is two-fold:

1. How do I post data back to the same dialog window?

2. The dialog window in question was, in turn, created from a dialog window.
I need to post data back to that one too (that which the user selected in
the top-most dialog window). How do I send data back to this window?

Regards
John.
 
Hi John,
Posting back in a modal dialog box has not worked for me in the past.

I woud like to see if it works for you?

Cheers,
Angus
 
Hi

2 ways to post to a dialog

1 Place a iframe/frameset in the dialog and host the page there
2 <base target="_self">

Returning value to the opener:
( Iframe )
parent.window.returnValue = theValue;
parent.window.close();

( Frameset )
top.returnValue = theValue;
top.close();

(<base target="_self"> )
window.returnValue = theValue;
window.close();

Getting value in the opener
var res = showModalDialog(........);
if(typeof(res) != "undefined") alert(res);

If returning more than 1 value you can use comma delimited.....

More info
http://msdn.microsoft.com/library/d...hor/dhtml/reference/dhtml_reference_entry.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/js56jsoriJScript.asp

--
Best Regards
Vidar Petursson
==============================
Microsoft Internet Client & Controls MVP
==============================
 
Back
Top