Posting data back to a modal dialog window

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.
 
A

Angus Logan

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
 
V

Vidar Petursson

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
==============================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top