File Download from window.ShowModalDialog

G

Guest

Hello,

Using asp.net 2.0, C# and IE7

I'm using window.showModalDialog to open a modal window on the client from
Javascript.
I have to include this line in the < HEAD > html of the modal window:
<base target=_self> because whenever that page posted back, it would spawn
off a new window!! This is the beaviour in IE7.

In this Modal Window I need to have a File Download functionality.
The problem is that using <base target=_self> the File Download dialog don't
popup, but if I remove the <base target=_self> the File Download dialog
appears but it would spawn off a new window from the Modal Dialog.

Thanks for any suggestions on how to resolve this issue

Joao Rego
 
M

Mark Rae [MVP]

Using asp.net 2.0, C# and IE7

I'm using window.showModalDialog to open a modal window on the client from
Javascript.
I have to include this line in the < HEAD > html of the modal window:
<base target=_self> because whenever that page posted back, it would spawn
off a new window!! This is the behaviour in IE7.

And in earlier versions...
In this Modal Window I need to have a File Download functionality.
The problem is that using <base target=_self> the File Download dialog
don't
popup, but if I remove the <base target=_self> the File Download dialog
appears but it would spawn off a new window from the Modal Dialog.

That's correct.
Thanks for any suggestions on how to resolve this issue

The easiest method is simply not to use showModalDialog - it's completely
non-standard, and only works in IE and some versions of Safari...

Why do you need to use showModalDialog anyway...?
 
G

Guest

Hi Mark Rae,

Thanks for the advice but I'm mimic a WindowsApp to WebApp, so I have to
create the UI as close as possible.

In respect to this problem I work around it creating a dummy dialog that
only writes out an iframe with src = the dialog i want to load.

thanks,

joao rego
 
M

Mark Rae [MVP]

Thanks for the advice but I'm mimic a WindowsApp to WebApp, so I have to
create the UI as close as possible.

WinForms and WebForms are fundamentally different - I wouldn't advise this
approach at all...
In respect to this problem I work around it creating a dummy dialog that
only writes out an iframe with src = the dialog i want to load.

Modal dialogs are fairly easy to simulate with <div> controls:
http://www.hell.org.ua/Docs/oreilly...ipt/0596004672_jvdhtmlckbk-chp-6-sect-10.html
 
G

Guest

Thanks for this new approach, I tried the sample and it has the behaviour
very similar to the window.ShowModalDialog(...), since this is more standard
I guess I'll have to change all my ModalDialogs.
Thanks again for your help
 

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,577
Members
45,052
Latest member
LucyCarper

Latest Threads

Top