How to refresh calling window from a popup window

Discussion in 'ASP .Net' started by =?Utf-8?B?T3Bh?=, Jun 13, 2006.

  1. Hi ,

    I have a form with javasript which launches a popup via the showModalDialog()
    method. I get the dialog to open, now I am trying to first get a reference
    to the calling form from the popup and then do a refresh of the calling form.

    Any ideas on how to get a reference to the calling form?
    I tried window.parent.location.reload() , but it doesn't work.

    Thanks a lot.
     
    =?Utf-8?B?T3Bh?=, Jun 13, 2006
    #1
    1. Advertising

  2. You can't refresh the calling window from the popup, as it's waiting for
    the showModalDialog call to return.

    When you close the popup, return a value (in window.returnValue) that
    indicates to the code in the calling window that it needs to refresh itself.

    Opa wrote:
    > Hi ,
    >
    > I have a form with javasript which launches a popup via the showModalDialog()
    > method. I get the dialog to open, now I am trying to first get a reference
    > to the calling form from the popup and then do a refresh of the calling form.
    >
    > Any ideas on how to get a reference to the calling form?
    > I tried window.parent.location.reload() , but it doesn't work.
    >
    > Thanks a lot.
     
    =?UTF-8?B?R8O2cmFuIEFuZGVyc3Nvbg==?=, Jun 14, 2006
    #2
    1. Advertising

  3. =?Utf-8?B?T3Bh?=

    NumbLock Guest

    =?UTF-8?B?R8O2cmFuIEFuZGVyc3Nvbg==?= <> wrote in
    news:e$:

    > You can't refresh the calling window from the popup, as it's waiting
    > for the showModalDialog call to return.
    >
    > When you close the popup, return a value (in window.returnValue) that
    > indicates to the code in the calling window that it needs to refresh
    > itself.
    >
    > Opa wrote:
    >> Hi ,
    >>
    >> I have a form with javasript which launches a popup via the
    >> showModalDialog() method. I get the dialog to open, now I am trying
    >> to first get a reference to the calling form from the popup and then
    >> do a refresh of the calling form.
    >>
    >> Any ideas on how to get a reference to the calling form?
    >> I tried window.parent.location.reload() , but it doesn't work.
    >>
    >> Thanks a lot.


    Hi Guys. What opa wrote for a response to this can be true in a VB.net
    windows forms application (depending on how the child form is called).
    ASP.Net is a different animal. Web pages are stateless and have no
    notion of modality. The javascript code to open the popup is processed
    either during the page load, or is called in response to an onClick event
    or something like that.

    You can get a reference to the parent form using window.opener. To
    refresh the parent form from the child you would use window.opener.reload
    ()


    --
    *~!NumbLock!~*
     
    NumbLock, Jun 14, 2006
    #3
  4. NumbLock wrote:
    > =?UTF-8?B?R8O2cmFuIEFuZGVyc3Nvbg==?= <> wrote in
    > news:e$:
    >
    >> You can't refresh the calling window from the popup, as it's waiting
    >> for the showModalDialog call to return.
    >>
    >> When you close the popup, return a value (in window.returnValue) that
    >> indicates to the code in the calling window that it needs to refresh
    >> itself.
    >>
    >> Opa wrote:
    >>> Hi ,
    >>>
    >>> I have a form with javasript which launches a popup via the
    >>> showModalDialog() method. I get the dialog to open, now I am trying
    >>> to first get a reference to the calling form from the popup and then
    >>> do a refresh of the calling form.
    >>>
    >>> Any ideas on how to get a reference to the calling form?
    >>> I tried window.parent.location.reload() , but it doesn't work.
    >>>
    >>> Thanks a lot.

    >
    > Hi Guys. What opa wrote for a response to this can be true in a VB.net
    > windows forms application (depending on how the child form is called).
    > ASP.Net is a different animal. Web pages are stateless and have no
    > notion of modality. The javascript code to open the popup is processed
    > either during the page load, or is called in response to an onClick event
    > or something like that.
    >
    > You can get a reference to the parent form using window.opener. To
    > refresh the parent form from the child you would use window.opener.reload
    > ()
    >


    The question actually has nothing at all to do with ASP.NET.

    What the OP is talking about is the window.showModalDialog method, that
    is specific for Internet Explorer. It opens a page as a modal dialog,
    and waits for the page to close before returning to the parent page.

    As the parent page is busy running the Javascript code that opened the
    popup, it can't be refreshed until the popup is closed.
     
    =?ISO-8859-1?Q?G=F6ran_Andersson?=, Jun 14, 2006
    #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. Andy
    Replies:
    1
    Views:
    1,365
    Gregory A. Beamer
    Apr 21, 2010
  2. Pkenty
    Replies:
    0
    Views:
    420
    Pkenty
    May 28, 2004
  3. Jens Peter Hansen
    Replies:
    7
    Views:
    572
    Randy Webb
    Jun 19, 2004
  4. Raffi
    Replies:
    4
    Views:
    248
    Dr John Stockton
    Aug 12, 2004
  5. Jimmy
    Replies:
    1
    Views:
    336
    Thomas 'PointedEars' Lahn
    Oct 6, 2007
Loading...

Share This Page