473,387 Members | 1,619 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,387 software developers and data experts.

Firing an event on close of window

RJN
Hi

I have a datagrid which has linkbutton as a template column. The
Linkbutton is used to open new windows. I can open multiple windows at a
time. On close of any of the child windows,(i.e, on click of "X" at
TopRight corner) I have to perform a database operation, basically to
release some locks and I can do only on closing of window. How I can I
do this. Is there any Page event? Page_Unload didn't help me.

Thanks

RJN

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #1
2 2483
depending upon browser's closing is a bad design.
consider this what if something went wrong and say IE closed all instances..
or the person went to task manager and closed the instance. what if the
person browsed to another site ?
At those time you will not be able to trap the unload event.

The event you want is a onunload event on the page.
its available clientside so you will have to use javascript.

say redirect to another page which has sole responsibility of releasing the
locks and onload of that page make sure it has javascript:window.close();
ie in the second page.. on serverside you can directly unlock before the
page is rendered. when its rendered on the clients browser window.close will
fire.

i am not sure to what extent this will work. but you can always spawn
another window using javascript:window.open();

Would like to stress on it so mentioning it again. Relying on onunload is
not desirable and you would face instances were the items were kept locked
because the call unload event never called

Pray that your clients dont XP SP2 and if they have it they havent disabled
Popup blocker or if anything they arent using any popupblockers

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"RJN" <rj*@yahoo.com> wrote in message
news:#W**************@TK2MSFTNGP09.phx.gbl...
Hi

I have a datagrid which has linkbutton as a template column. The
Linkbutton is used to open new windows. I can open multiple windows at a
time. On close of any of the child windows,(i.e, on click of "X" at
TopRight corner) I have to perform a database operation, basically to
release some locks and I can do only on closing of window. How I can I
do this. Is there any Page event? Page_Unload didn't help me.

Thanks

RJN

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #2
ooops meant clients not using popup blockers ones with xp2 or anyother..
otherwise educate your clients to add the application to Allowed List

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Hermit Dave" <he************@CAPS.AND.DOTS.hotmail.com> wrote in message
news:#S**************@tk2msftngp13.phx.gbl...
depending upon browser's closing is a bad design.
consider this what if something went wrong and say IE closed all instances.. or the person went to task manager and closed the instance. what if the
person browsed to another site ?
At those time you will not be able to trap the unload event.

The event you want is a onunload event on the page.
its available clientside so you will have to use javascript.

say redirect to another page which has sole responsibility of releasing the locks and onload of that page make sure it has javascript:window.close();
ie in the second page.. on serverside you can directly unlock before the
page is rendered. when its rendered on the clients browser window.close will fire.

i am not sure to what extent this will work. but you can always spawn
another window using javascript:window.open();

Would like to stress on it so mentioning it again. Relying on onunload is
not desirable and you would face instances were the items were kept locked
because the call unload event never called

Pray that your clients dont XP SP2 and if they have it they havent disabled Popup blocker or if anything they arent using any popupblockers

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"RJN" <rj*@yahoo.com> wrote in message
news:#W**************@TK2MSFTNGP09.phx.gbl...
Hi

I have a datagrid which has linkbutton as a template column. The
Linkbutton is used to open new windows. I can open multiple windows at a
time. On close of any of the child windows,(i.e, on click of "X" at
TopRight corner) I have to perform a database operation, basically to
release some locks and I can do only on closing of window. How I can I
do this. Is there any Page event? Page_Unload didn't help me.

Thanks

RJN

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 18 '05 #3

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

Similar topics

9
by: Susan Bricker | last post by:
I am currently using the OnDirty event of a Form to detect whether any fields have been modified. I set a boolean variable. Then, if the Close button is clicked before the Save button, I can put...
1
by: Edward | last post by:
I am having a terrible time getting anything useful out of a listbox on my web form. I am populating it with the results from Postcode lookup software, and it is showing the results fine. What...
0
by: ChrisB | last post by:
I'm attempting to open a new window from a LinkButton in a DataGrid. I can set a session variable in the ItemCommand event for the LinkButton like so: // this is used to handle the ItemCommand...
1
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at...
5
by: Raghu Raman | last post by:
HI, am using a simple project in asp.net using c#. if i put the break point in the application start & session start event , they are firing good .BUT WHEN i close my project while running on...
13
by: Chris | last post by:
I can create Javascript confirm message boxes during page creation, etc adding them to the button attributes (many good posts on this!). But how can I add this event after the button is pressed? I...
4
by: Steve | last post by:
<script language=javascript> function selectFile(fileUrl) { if(navigator.appName.indexOf('Microsoft')!=-1) window.returnValue=fileUrl; else window.opener.setAssetValue(fileUrl); self.close();...
12
by: Chad | last post by:
Hi In vb.net if you add a webbrowser control the windowclosing event does not fire. I have searched everywhere for a solution rather I get more people saying I have the same problem. I found...
21
by: brucedodds | last post by:
I have an Access 2003 form bound to a SQL Server table via ODBC. Often clicking a button on the form has the effect of requerying the form rather than firing the OnClick event. Does anyone have...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...

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.