Master Page lifecycle

G

Guest

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
 
T

Teemu Keiski

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top