File Download from window.ShowModalDialog

Discussion in 'ASP .Net' started by =?Utf-8?B?Sm9hbyBSZWdv?=, Oct 23, 2007.

  1. 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
    =?Utf-8?B?Sm9hbyBSZWdv?=, Oct 23, 2007
    #1
    1. Advertising

  2. "Joao Rego" <> wrote in message
    news:...

    > 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
    Mark Rae [MVP], Oct 23, 2007
    #2
    1. Advertising

  3. 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
    =?Utf-8?B?Sm9hbyBSZWdv?=, Oct 23, 2007
    #3
  4. "Joao Rego" <> wrote in message
    news:...

    > 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


    --
    Mark Rae
    ASP.NET MVP
    http://www.markrae.net
    Mark Rae [MVP], Oct 23, 2007
    #4
  5. 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" <> wrote in message
    > news:...
    >
    > > 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
    >
    >
    > --
    > Mark Rae
    > ASP.NET MVP
    > http://www.markrae.net
    >
    >
    =?Utf-8?B?Sm9hbyBSZWdv?=, Oct 23, 2007
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John
    Replies:
    1
    Views:
    3,167
  2. sunita

    File Download in showModalDialog

    sunita, Feb 7, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    609
    sunita
    Feb 7, 2007
  3. kurt sune
    Replies:
    2
    Views:
    7,414
    imransyed63
    Aug 19, 2008
  4. Gilles T.
    Replies:
    1
    Views:
    158
    Jim Ley
    Jan 18, 2004
  5. Jonathan
    Replies:
    0
    Views:
    175
    Jonathan
    Jul 19, 2004
Loading...

Share This Page