How get modal window to stay open?!!!

Discussion in 'ASP .Net' started by Bobby Edward, Oct 8, 2008.

  1. Bobby Edward

    Bobby Edward Guest

    I am doing a simple master/detail page (gridview/detailsview).

    I put the detailsview in a hidden panel and am using the modalpopupextender
    to display it.

    The details view should allow view, insert and update/cancel.

    PROBLEM: The popup works perfect. BUT, when I click ANYTHING, such as
    'edit', or 'new', the model CLOSES. If I reopen the model I see that the
    action has taken place. Any idea how I can PREVENT it from closing
    automatically?
    Bobby Edward, Oct 8, 2008
    #1
    1. Advertising

  2. Bobby Edward

    Bobby Edward Guest

    I put it in an UpdatePanel and it seemed to fix it.

    I'll have to research your solution.

    For some reason though, when I hit the close button on the model I can't get
    the page data to update. Any ideas?

    "Mark Rae [MVP]" <> wrote in message
    news:%...
    > "Bobby Edward" <> wrote in message
    > news:O$...
    >
    >> Any idea how I can prevent it from closing automatically?

    >
    > <head>
    > <base target="_self" />
    > </head>
    >
    >
    > --
    > Mark Rae
    > ASP.NET MVP
    > http://www.markrae.net
    Bobby Edward, Oct 8, 2008
    #2
    1. Advertising

  3. Bobby Edward

    bruce barker Guest

    the modalpopup does not open a window. it just display a div that was
    hidden. if your page does a postback, the page rerenders and the popup
    is not displayed (unless you put javascript code to do it - bad idea).

    if you put an update panel in the popup, then a rerender is not done, so
    the popup does not disappear. if you click close, the div i just hidden,
    and no async postback is done. if you need the close to save, replace
    with an update trigger then generate javascript that close the popup.
    i think you need to add a close method to the popup as it does not have one.

    -- bruce (sqlwork.com)

    Bobby Edward wrote:
    > I am doing a simple master/detail page (gridview/detailsview).
    >
    > I put the detailsview in a hidden panel and am using the modalpopupextender
    > to display it.
    >
    > The details view should allow view, insert and update/cancel.
    >
    > PROBLEM: The popup works perfect. BUT, when I click ANYTHING, such as
    > 'edit', or 'new', the model CLOSES. If I reopen the model I see that the
    > action has taken place. Any idea how I can PREVENT it from closing
    > automatically?
    >
    >
    bruce barker, Oct 9, 2008
    #3
  4. Bobby Edward

    Bobby Edward Guest

    "bruce barker" <> wrote in message
    news:...
    > the modalpopup does not open a window. it just display a div that was
    > hidden. if your page does a postback, the page rerenders and the popup is
    > not displayed (unless you put javascript code to do it - bad idea).
    >
    > if you put an update panel in the popup, then a rerender is not done, so
    > the popup does not disappear. if you click close, the div i just hidden,
    > and no async postback is done. if you need the close to save, replace with
    > an update trigger then generate javascript that close the popup. i think
    > you need to add a close method to the popup as it does not have one.
    >
    > -- bruce (sqlwork.com)
    >


    Thanks. It really sounds like that's what I need to do. Do you have a link
    that I can look at to read more (or sample code)? Thanks!
    Bobby Edward, Oct 9, 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. Matt
    Replies:
    1
    Views:
    3,122
    Whitecrest
    Jun 1, 2004
  2. mkengel
    Replies:
    5
    Views:
    10,855
    sf_cesario659
    Jun 26, 2009
  3. Paul
    Replies:
    2
    Views:
    136
  4. Matt
    Replies:
    0
    Views:
    211
  5. gopal srinivasan
    Replies:
    0
    Views:
    217
    gopal srinivasan
    Nov 5, 2004
Loading...

Share This Page