Professional Web Applications Themes

Refresh Parent window from child window causes problems - ASP.NET General

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.location.reload(true) and window.opener.reload(true). when I did this, IE came up saying "This page cannot be refreshed ...

  1. #1

    Default 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.location.reload(true)
    and window.opener.reload(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
    Raj Guest

  2. #2

    Default 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.location=opener.location;" or if this doesn't work "opener.location=null; opener.location=opener.location;" or something.

    HTH,
    Axel Dahmen

    ------------------------------
    "Raj" <phoenix_cbe> schrieb im Newsbeitrag news:2624d049.0306301001.33571e7dposting.google.c om...
    > 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.location.reload(true)
    > and window.opener.reload(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 Guest

  3. #3

    Default 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.location = '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.forms[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
    [url]http://www.takempis.com[/url]
    Big things are made up of
    lots of Little things.

    "Raj" <phoenix_cbe> wrote in message
    news:2624d049.0306301001.33571e7dposting.google.c om...
    > 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.location.reload(true)
    > and window.opener.reload(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

    Kevin Spencer Guest

Similar Threads

  1. Replies: 6
    Last Post: September 2nd, 05:16 PM
  2. Close a pop-up, and refresh it's parent window
    By chriskeeler2 in forum Coldfusion - Getting Started
    Replies: 1
    Last Post: September 14th, 07:11 PM
  3. Acessing parent window from child on a Mac
    By John Holmes in forum ASP
    Replies: 1
    Last Post: August 20th, 05:27 AM
  4. refresh parent window on close showModalDialog?
    By Simon Storr in forum ASP.NET
    Replies: 2
    Last Post: August 4th, 03:34 PM
  5. Refresh a parent window???
    By Helixpoint in forum ASP.NET General
    Replies: 1
    Last Post: July 3rd, 02:41 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139