Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > File Download from window.ShowModalDialog

Reply
Thread Tools

File Download from window.ShowModalDialog

 
 
=?Utf-8?B?Sm9hbyBSZWdv?=
Guest
Posts: n/a
 
      10-23-2007
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
 
Reply With Quote
 
 
 
 
Mark Rae [MVP]
Guest
Posts: n/a
 
      10-23-2007
"Joao Rego" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

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


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

 
Reply With Quote
 
 
 
 
=?Utf-8?B?Sm9hbyBSZWdv?=
Guest
Posts: n/a
 
      10-23-2007
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

 
Reply With Quote
 
Mark Rae [MVP]
Guest
Posts: n/a
 
      10-23-2007
"Joao Rego" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> 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/...6-sect-10.html


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

 
Reply With Quote
 
=?Utf-8?B?Sm9hbyBSZWdv?=
Guest
Posts: n/a
 
      10-23-2007
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


"Mark Rae [MVP]" wrote:

> "Joao Rego" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
> > 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/...6-sect-10.html
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Forcing Download of File Appends HTML from Download Page to Downloaded File? Brett Kelly ASP .Net 1 06-16-2006 04:05 AM
problem with code download file - two window file download Sam -- ASP .Net 2 03-17-2005 04:20 PM
Re: How can I display a download link in my (C#) ASP.NET web form to download a file stored in my sql db? Steve C. Orr [MVP, MCSD] ASP .Net 0 03-07-2005 07:14 PM
File upload/download from database. Download appends aspx page to end of file Ryan Taylor ASP .Net 2 11-10-2004 08:31 PM



Advertisments