The showModalDialog is an IE only mehod so it totally breaks cross-browser
compatibility. Also, because it is a modal dialog to the parent window, the
only way to submit the values are to also submit the parent window. It is
all client side functionality so really ASP.NET doesn't change it.
The problem I see people having a lot is that they want the modal window to
remain open and continue from where they were after the submission. To do
that, I think the only way is to do something like setting a client side
script to reopen the dialog in from the window.onload client event.
From your question, I am assuming you know enough about using the dialog to
pass variables from the parent to the dialog, and back to the parent again,
so it should be pretty easy...
Create the dialog while passing required values->process user input->pass
user input back to parent->save parent state in hidden (or not hidden, if
appropriate) form elements->submit parent->recreate parent values in
codebehind->parent reloads and extracts the values->parent recreates its own
state->parent recreates dialog passing state to dialog again.
The end result, even if it's a long way to get there, is as if you kept the
submit functionality in the dialog.
If there's another way to do it, I haven't seen one.
Dale Preston
MCAD, MCSE, MCDBA
"Mark Rae" <ma**@mark-N-O-S-P-A-M-rae.co.uk> wrote in message
news:#j**************@TK2MSFTNGP09.phx.gbl...
Hi,
I'm opening an ASP.NET page using the JavaScript window.showModalDialog
method. This page has a submission button on it which, when clicked, opens
a new window, which is pretty much as expected. However, I want it to keep
the submission within the modal dialog. Looking round the net, it seems that
this is not an uncommon problem and that people are using an iframe to
solve it. Fair enough - that's not difficult.
However, I'm interested to know:
1) is there really no other way to achieve this in ASP.NET?
2) just how badly does this break browser compatibility?
Thanks,
Mark