473,796 Members | 2,444 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.l ocation.href = window.opener.l ocation.href;
if (window.opener. progressWindow)
window.opener.p rogressWindow.c lose();
window.close();
}
</script>

<body onunload="refre shParent()">

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

thanks

Jul 5 '06 #1
1 1935
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********@dis cussions.micros oft.comwrote in message
news:E2******** *************** ***********@mic rosoft.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.l ocation.href = window.opener.l ocation.href;
if (window.opener. progressWindow)
window.opener.p rogressWindow.c lose();
window.close();
}
</script>

<body onunload="refre shParent()">

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
1015
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 linkbuttons (or other webcontrols). These linkbuttons have to be created after events are processed, and so these linkbuttons cannot have handlers added to them because they are too late in the page lifecycle for the handlers to register. An example:
2
3631
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
2022
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 created in the constructor of my Page, but I need them to know about some info that get's set via the Page_Load from the Request (and even Session for that matter) thanks! Dave
4
2073
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 = True, I would then have the Control.BeginInvoke(New AsyncCallback(AddressOf GetDataCallback), New Object() {ar}). How would one achieve the same thing on an asp.net page (without using a webseervice)? In the code below, because the...
12
4578
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 there a way to do this? (My understanding is this has to be done in the form tag.) -- thanks - dave david_at_windward_dot_net
0
991
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 content page is redrawn) if the call is found in the body tag. * 'return false' attribute does resolve this but now to actually update the content page.
2
3192
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 to get a little more information to lock down what I think I know and also to answer a couple little questions. Given a base page, and the page inheriting it, as I understand it, the page lifecycle flows like this: 1) Page is requested
2
1264
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 Membership object is still alive. If not, it redirects to the login page. If so, it lets the user see whatever page they were after. My issue is that it seems sometimes this event doesn't fire when it's supposed to, and I'll get "object refrence...
6
1691
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 templates in that when the master page is updated, all the child pages created from the master page are updated and then they all need to be uploaded to the server? Or do you only have to upload the master page after an update?
0
9680
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10455
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10228
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10006
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9052
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5441
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4116
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.