Submission of modal dialogs

M

Mark Rae

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
 
D

Dale

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
 
M

Mark Rae

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

Yeah - that in itself isn't the problem. I was merely wondering if there
wasn't a more efficient ".NET" way of achieving the same functionality...
If there's another way to do it, I haven't seen one.

That's what I'm finding...
 

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,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top