Master Page lifecycle

Discussion in 'ASP .Net' started by =?Utf-8?B?bWdvbnphbGVzMw==?=, Jul 5, 2006.

  1. I have a popup that does a postback to populate a listbox. on my content
    page I want to fire a jscript that will refresh the parent on the unload. the
    code on the content page looks like this.

    <script>
    function refreshParent()
    {
    window.opener.location.href = window.opener.location.href;
    if (window.opener.progressWindow)
    window.opener.progressWindow.close();
    window.close();
    }
    </script>

    <body onunload="refreshParent()">

    Why does the event fire if all i'm doing is doing a search postback?
    ideas?

    thanks
     
    =?Utf-8?B?bWdvbnphbGVzMw==?=, Jul 5, 2006
    #1
    1. Advertising

  2. =?Utf-8?B?bWdvbnphbGVzMw==?=

    Teemu Keiski Guest

    That's client side onunload and basically from client-side of view when you
    do a postback, you unload the current page and load a new one.

    Per MSDN's documentation following actions cause onunload to fire

    a.. Close the current browser window.
    b.. Navigate to another location by entering a new address or selecting a
    Favorite.
    c.. Click the Back, Forward, Refresh, or Home button.
    d.. Click on an anchor that refers the browser to another Web page.
    e.. Invoke the anchor click method.
    f.. Invoke the document write method.
    g.. Invoke the document open method.
    h.. Invoke the document close method.
    i.. Invoke the window close method.
    j.. Invoke the window open method, providing the possible value _self for
    the window name.
    k.. Invoke the window navigate or NavigateAndFind method.
    l.. Invoke the location replace method.
    m.. Invoke the location reload method.
    n.. Specify a new value for the location href property.
    o.. Submit a form to the address specified in the ACTION attribute via the
    INPUT type=submit control, or invoke the submit method.
    --
    Teemu Keiski
    ASP.NET MVP, AspInsider
    Finland, EU
    http://blogs.aspadvice.com/joteke

    "mgonzales3" <> wrote in message
    news:...
    >I have a popup that does a postback to populate a listbox. on my content
    > page I want to fire a jscript that will refresh the parent on the unload.
    > the
    > code on the content page looks like this.
    >
    > <script>
    > function refreshParent()
    > {
    > window.opener.location.href = window.opener.location.href;
    > if (window.opener.progressWindow)
    > window.opener.progressWindow.close();
    > window.close();
    > }
    > </script>
    >
    > <body onunload="refreshParent()">
    >
    > Why does the event fire if all i'm doing is doing a search postback?
    > ideas?
    >
    > thanks
    >
     
    Teemu Keiski, Jul 5, 2006
    #2
    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. Doug McCann
    Replies:
    1
    Views:
    1,154
    William Brogden
    Aug 5, 2004
  2. =?Utf-8?B?bWdvbnphbGVzMw==?=

    Master Page Lifecycle (note)

    =?Utf-8?B?bWdvbnphbGVzMw==?=, Jul 5, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    315
    =?Utf-8?B?bWdvbnphbGVzMw==?=
    Jul 5, 2006
  3. Zeba
    Replies:
    1
    Views:
    546
    Mark Rae
    Feb 22, 2007
  4. =?Utf-8?B?ZHNvcnJlbGw=?=

    Lifecycle question regarding master pages

    =?Utf-8?B?ZHNvcnJlbGw=?=, Sep 13, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    308
    =?Utf-8?B?ZHNvcnJlbGw=?=
    Sep 14, 2007
  5. Nathan Sokalski
    Replies:
    25
    Views:
    1,508
    Nathan Sokalski
    Mar 4, 2010
Loading...

Share This Page