AJAX: Closing a modal popup dialog

Discussion in 'ASP .Net' started by Mike Hofer, Jul 31, 2008.

  1. Mike Hofer

    Mike Hofer Guest

    Okay, here's the situation: we want to be able to display ASPX pages
    in an UpdatePanel. The reasons for this are performance related. The
    site in development uses *lots* of modal popups from some pages, and
    we don't want to load all that content until it's requested.

    So, what we want to do is place an IFRAME inside an UpdatePanel and,
    in the onclick event for the linkbutton or button control, set the SRC
    so that the content is loaded on demand. So far, so good.

    What I can't seem to figure out, at this point, is how you would go
    about closing the modal popup once it's displayed. In theory, the
    heirarchy looks like this:

    Page
    Button/LinkButton
    ModalPopupExtender
    UpdatePanel
    IFrame
    Page
    OK/Cancel button

    I'm relatively new to this Ajax business, but I've manged to figure
    out how to get the page to load display in the IFrame when I want it
    to, and that's all spiffy. Now I just need to know how to get it to
    close in response to the user's actions.

    Any help would be greatly appreciated.

    Thanks!

    Mike
     
    Mike Hofer, Jul 31, 2008
    #1
    1. Advertising

  2. Mike Hofer

    Marc Guest

    Re: Closing a modal popup dialog

    I can't answer your specific question, but I would put it all in a panel and
    make it invisible unless you call the model popup. That way it wont load in
    the page, and the buttons on the panel will close the model popup.

    Marc


    "Mike Hofer" <> wrote in message
    news:...
    > Okay, here's the situation: we want to be able to display ASPX pages
    > in an UpdatePanel. The reasons for this are performance related. The
    > site in development uses *lots* of modal popups from some pages, and
    > we don't want to load all that content until it's requested.
    >
    > So, what we want to do is place an IFRAME inside an UpdatePanel and,
    > in the onclick event for the linkbutton or button control, set the SRC
    > so that the content is loaded on demand. So far, so good.
    >
    > What I can't seem to figure out, at this point, is how you would go
    > about closing the modal popup once it's displayed. In theory, the
    > heirarchy looks like this:
    >
    > Page
    > Button/LinkButton
    > ModalPopupExtender
    > UpdatePanel
    > IFrame
    > Page
    > OK/Cancel button
    >
    > I'm relatively new to this Ajax business, but I've manged to figure
    > out how to get the page to load display in the IFrame when I want it
    > to, and that's all spiffy. Now I just need to know how to get it to
    > close in response to the user's actions.
    >
    > Any help would be greatly appreciated.
    >
    > Thanks!
    >
    > Mike
     
    Marc, Jul 31, 2008
    #2
    1. Advertising

  3. Mike Hofer

    Mike Hofer Guest

    Re: Closing a modal popup dialog

    On Jul 31, 4:22 pm, "Marc " <> wrote:
    > I can't answer your specific question, but I would put it all in a panel and
    > make it invisible unless you call the model popup. That way it wont load in
    > the page, and the buttons on the panel will close the model popup.
    >
    > Marc
    >
    > "Mike Hofer" <> wrote in message
    >
    > news:...
    >
    >
    >
    > > Okay, here's the situation: we want to be able to display ASPX pages
    > > in an UpdatePanel. The reasons for this are performance related. The
    > > site in development uses *lots* of modal popups from some pages, and
    > > we don't want to load all that content until it's requested.

    >
    > > So, what we want to do is place an IFRAME inside an UpdatePanel and,
    > > in the onclick event for the linkbutton or button control, set the SRC
    > > so that the content is loaded on demand. So far, so good.

    >
    > > What I can't seem to figure out, at this point, is how you would go
    > > about closing the modal popup once it's displayed. In theory, the
    > > heirarchy looks like this:

    >
    > > Page
    > >   Button/LinkButton
    > >   ModalPopupExtender
    > >   UpdatePanel
    > >      IFrame
    > >         Page
    > >            OK/Cancel button

    >
    > > I'm relatively new to this Ajax business, but I've manged to figure
    > > out how to get the page to load display in the IFrame when I want it
    > > to, and that's all spiffy. Now I just need to know how to get it to
    > > close in response to the user's actions.

    >
    > > Any help would be greatly appreciated.

    >
    > > Thanks!

    >
    > > Mike- Hide quoted text -

    >
    > - Show quoted text -


    On these three pages we're developing, each page displays up to eight
    modal dialog boxes of varying complexity. Several of these dialog
    boxes include data repeaters with *lots* of data. We don't want those
    pages loading until the user asks for them.

    (Don't ask me why these are being displayed in modal dialog boxes.
    Let's just say the creative department was smoking some really good
    stuff, and no one from the software engineering department was
    involved at the time to restrain their "Gee Whiz" impulses.)

    So, embedding eight different dialog boxes on a single page with data
    repeaters and all their data is impractical on a *very* high traffic
    web site. I need to load this stuff dynamically. Further, some of
    these pages have unique styling requirements, and I don't want to load
    the style sheets for all those dialog boxes and further bloat the
    request size. If I can just load the page when it's asked for and it's
    size (and script) requirements, that's optimal.

    Thanks,
    Mike
     
    Mike Hofer, Jul 31, 2008
    #3
  4. Mike Hofer

    bruce barker Guest

    the easiest way to do this is two hidden buttons, one as the targetid,
    and one as the okcontrolid. then from client script just fire the
    correct click to open/close the popup. the ok button in the iframe would
    call a routine the parent to close (which would just fire the hidden ok
    button). when you close the popup set the iframe src to a empty page, so
    when you open it again, you don't have the last page displaying

    -- bruce (sqlwork.com)





    Mike Hofer wrote:
    > Okay, here's the situation: we want to be able to display ASPX pages
    > in an UpdatePanel. The reasons for this are performance related. The
    > site in development uses *lots* of modal popups from some pages, and
    > we don't want to load all that content until it's requested.
    >
    > So, what we want to do is place an IFRAME inside an UpdatePanel and,
    > in the onclick event for the linkbutton or button control, set the SRC
    > so that the content is loaded on demand. So far, so good.
    >
    > What I can't seem to figure out, at this point, is how you would go
    > about closing the modal popup once it's displayed. In theory, the
    > heirarchy looks like this:
    >
    > Page
    > Button/LinkButton
    > ModalPopupExtender
    > UpdatePanel
    > IFrame
    > Page
    > OK/Cancel button
    >
    > I'm relatively new to this Ajax business, but I've manged to figure
    > out how to get the page to load display in the IFrame when I want it
    > to, and that's all spiffy. Now I just need to know how to get it to
    > close in response to the user's actions.
    >
    > Any help would be greatly appreciated.
    >
    > Thanks!
    >
    > Mike
     
    bruce barker, Aug 1, 2008
    #4
    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. =?Utf-8?B?Vk1J?=

    Closing popup window when closing parent window?

    =?Utf-8?B?Vk1J?=, Feb 14, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    678
    Thomas Hansen
    Feb 15, 2007
  2. Orit
    Replies:
    1
    Views:
    603
    bruce barker
    Sep 11, 2007
  3. arvee2003
    Replies:
    0
    Views:
    1,812
    arvee2003
    Feb 1, 2011
  4. Bob Lehmann

    Modal Dialog Popup from WebControl - What is wrong with this...

    Bob Lehmann, Jul 23, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    4
    Views:
    191
    Jim Mitchell
    Aug 23, 2003
  5. Urs Gubler
    Replies:
    0
    Views:
    171
    Urs Gubler
    Jul 2, 2003
Loading...

Share This Page