By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,161 Members | 2,002 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,161 IT Pros & Developers. It's quick & easy.

Submission of modal dialogs

P: n/a
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
Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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

Nov 18 '05 #2

P: n/a
"Dale" <da************@msndotcomNot.Net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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...
Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.