File Download from window.ShowModalDialog

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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...?
 
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
 
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
 
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
 
Back
Top