Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2007

Tip: Looking for answers? Try searching our database.

File Download from window.ShowModalDialog

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Joao Rego - 23 Oct 2007 12:28 GMT
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
Mark Rae [MVP] - 23 Oct 2007 12:50 GMT
> Using asp.net 2.0, C# and IE7
>
[quoted text clipped - 3 lines]
> <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...?

Signature

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

Joao Rego - 23 Oct 2007 15:41 GMT
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
Mark Rae [MVP] - 23 Oct 2007 16:14 GMT
> 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/webprog/DHTML_javascript/0596004672_jvdhtmlc
kbk-chp-6-sect-10.html


Signature

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

Joao Rego - 23 Oct 2007 17:50 GMT
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

> > Thanks for the advice but I'm mimic a WindowsApp to WebApp, so I have to
> > create the UI as close as possible.
[quoted text clipped - 7 lines]
> Modal dialogs are fairly easy to simulate with <div> controls:
> http://www.hell.org.ua/Docs/oreilly/webprog/DHTML_javascript/0596004672_jvdhtmlc
kbk-chp-6-sect-10.html

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.