473,324 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Master Page lifecycle

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

Jul 5 '06 #1
1 1922
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" <mg********@discussions.microsoft.comwrote in message
news:E2**********************************@microsof t.com...
>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

Jul 5 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Epson Barnett | last post by:
I'm new to ASP.NET and have run across a problem several times while working on web apps. I often need to create content dynamically (based on an event) which contains dynamically created...
2
by: John Lau | last post by:
Hi, Is there documentation that talks about the page lifecycle, the lifecycle of controls on the page, and the rendering of inline code, in a single document? Thanks, John
3
by: malcolm | last post by:
Inside of a Page class, how do I capture the Request object values before the Page_Load event is called of that Page? I have a situation where I have many server controls on a Page that get...
4
by: Jeremy Holt | last post by:
Hi, In a windows.forms application I would BeginInvoke a delegate on the UI thread to collect data from a database. When the call returns to the AsyncCallback, if the Control.InvokeRequired =...
12
by: David Thielen | last post by:
Hi; I have my <form> in the master page because the master page includes the menu for all pages. But I would like to set the default button and control to place the caret in for each page. Is...
0
by: mgonzales3 | last post by:
I might add the following fly to the ointment: * content page opens a fully validated aspx page (no content page here) * everytime a posback is made on the aspx page the onunload event fires(the...
2
by: Gary W. Smith | last post by:
I have a page that inherits from a base page that is currently overriding all of the On* events. For the most part I'm accomplishing everything I set out to do with the inheritance, but I wanted...
2
by: =?Utf-8?B?ZHNvcnJlbGw=?= | last post by:
I've been having a recurring issue with master page authentication. Right now, I have verification code in the Page_Init event of the master page, which checks the Page.User object to make sure the...
6
by: Mickey | last post by:
Coming from a Dreamweaver/ASP/PHP background. Planning to use Visual Studio 2008 for a website. Complete newbie question here (please be gentle!): Do master pages work similar to Dreamweaver...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.