Refresh Parent window from child window causes problems

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Raj

    Refresh Parent window from child window causes problems

    Hi All,
    I have a problem with trying to refresh the parent window from
    child window in order to update data in the parent window.

    The sequence of events are
    1) I click a button in the parent window to open a child window thru
    javascript
    window.open

    2) I have some functionality in the child window that changes the data
    in the parent window.

    3) I need to refresh the parent window on child window closing

    I read some posts here and I did window.opener.l ocation.reload( true)
    and window.opener.r eload(true). when I did this, IE came up saying
    "This page cannot be refreshed without resending information, Click
    retry to send the information again ...." and all that crap when I hit
    this the page is refreshed, but the ItemCommand of the parent window
    had the same event that opened the child window and it opened it
    again.

    So even when I close it, I end up with the same window again.

    Can someone please help me to refresh my parent window without this
    message box and I dont want to have the child window open again

    TIA
    Raj
  • Axel Dahmen

    #2
    Re: Refresh Parent window from child window causes problems

    Hmmm, to me it seems quite obvious that the Refresh function re-opens your child window. This was exactly what happened when you loaded your page the last time - and Refresh just repeats this loading process.

    I'd set the parent window to a new location in order to have it "forget" its current state. Either by setting it to "opener.locatio n=opener.locati on;" or if this doesn't work "opener.locatio n=null; opener.location =opener.locatio n;" or something.

    HTH,
    Axel Dahmen

    ------------------------------
    "Raj" <phoenix_cbe@ya hoo.com> schrieb im Newsbeitrag news:2624d049.0 306301001.33571 e7d@posting.goo gle.com...[color=blue]
    > Hi All,
    > I have a problem with trying to refresh the parent window from
    > child window in order to update data in the parent window.
    >
    > The sequence of events are
    > 1) I click a button in the parent window to open a child window thru
    > javascript
    > window.open
    >
    > 2) I have some functionality in the child window that changes the data
    > in the parent window.
    >
    > 3) I need to refresh the parent window on child window closing
    >
    > I read some posts here and I did window.opener.l ocation.reload( true)
    > and window.opener.r eload(true). when I did this, IE came up saying
    > "This page cannot be refreshed without resending information, Click
    > retry to send the information again ...." and all that crap when I hit
    > this the page is refreshed, but the ItemCommand of the parent window
    > had the same event that opened the child window and it opened it
    > again.
    >
    > So even when I close it, I end up with the same window again.
    >
    > Can someone please help me to refresh my parent window without this
    > message box and I dont want to have the child window open again
    >
    > TIA
    > Raj[/color]

    Comment

    • Kevin Spencer

      #3
      Re: Refresh Parent window from child window causes problems

      The problem lies in the way that WebForms work (POSTing back to themselves),
      and the way the browser works. When a browser tries to refresh a page that
      is the result of a form submission, it is necessary to re-submit the form,
      as the form was generated as a result of a previous POST request.

      Your only solution is to not refresh the browser in the parent window, but
      to send a fresh GET request for the page, as if hyperlinked (as in
      "parent.locatio n = 'someURL'"). This may be problematic, as you probably
      want to retain the state of the page as it presently exists, and a fresh
      request for the page will return it in its' initial state. A workaround for
      this would be to append a QueryString to the request, so that the
      server-side class can read the QueryString in order to update itself to the
      proper state. Another workaround would be to re-post the parent form (as in
      "parent.for ms[0].submit()"). Again, you would have to make sure that the
      parent page could restore itself to its' correct state based upon the
      results of the post.

      HTH,

      Kevin Spencer
      Microsoft FrontPage MVP
      Internet Developer

      Big things are made up of
      lots of Little things.

      "Raj" <phoenix_cbe@ya hoo.com> wrote in message
      news:2624d049.0 306301001.33571 e7d@posting.goo gle.com...[color=blue]
      > Hi All,
      > I have a problem with trying to refresh the parent window from
      > child window in order to update data in the parent window.
      >
      > The sequence of events are
      > 1) I click a button in the parent window to open a child window thru
      > javascript
      > window.open
      >
      > 2) I have some functionality in the child window that changes the data
      > in the parent window.
      >
      > 3) I need to refresh the parent window on child window closing
      >
      > I read some posts here and I did window.opener.l ocation.reload( true)
      > and window.opener.r eload(true). when I did this, IE came up saying
      > "This page cannot be refreshed without resending information, Click
      > retry to send the information again ...." and all that crap when I hit
      > this the page is refreshed, but the ItemCommand of the parent window
      > had the same event that opened the child window and it opened it
      > again.
      >
      > So even when I close it, I end up with the same window again.
      >
      > Can someone please help me to refresh my parent window without this
      > message box and I dont want to have the child window open again
      >
      > TIA
      > Raj[/color]


      Comment

      Working...