Posting from a modal dialog

A

abb

I have a modal dialog to edit a Notes field. When the Save button is
pressed, that field should save the Notes, close the dialog and leave
the parent window unchanged (don't refresh or post).

How can I accomplish that?

Posting from the modal dialog always pops up a new browser window.
And submitting from the parent sends the entire form (not just the
notes). Ideas?
 
M

Mark Rae [MVP]

I have a modal dialog to edit a Notes field. When the Save button is
pressed, that field should save the Notes, close the dialog and leave
the parent window unchanged (don't refresh or post).

How can I accomplish that?

I'm not quite sure what the problem is here... If you pop a modal dialog
(presumably you're using the non-standard window.showModalDialog method),
closing that dialog won't cause the parent window to refresh or post back
unless you explicitly code it...
Posting from the modal dialog always pops up a new browser window.

Put the following in the header of the dialog window:

<base target="_self" />

Try to avoid showModalDialog - they work only in IE and Safari...
 
A

abb

Yes, I'm using showModalDialog to pop up the window. But when the
popup submits, it always opens a new browser window even with
target="_self". I read somewhere that there is no way to prevent that
behavior with a modal dialog. Is that incorrect?
 
M

Mark Rae [MVP]

Yes, I'm using showModalDialog to pop up the window.

Presumably this is an internal intranet system, as you wouldn't use this on
a public Internet site...?
But when the popup submits, it always opens a new browser window even with
target="_self".

Are you absolutely certain you have it in the right place, and spelled
correctly...?

<head>
<base target="_self" />
I read somewhere that there is no way to prevent that behavior with a
modal dialog.
Is that incorrect?

That is incorrect.

However, as previously mentioned, you'd be much better off not using
showModalDialog at all, as there are far better ways of achieving the same
thing:
http://www.asp.net/AJAX/AjaxControlToolkit/Samples/ModalPopup/ModalPopup.aspx
 

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

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top