o
k
q
u
e
s
t
i
o
n
s
.
c
o
m

Trapping Browser close -

I have a form that locks some parts of my database when a user is in the form, and I want to make sure when they leave I release those resources. The problem is of course that if they hit the X button to close the form I can't catch it. What I've tried to do to fix it is add an event to the body onbeforeunload event, and then if the mouse Y position is less than zero, pop a logout type page with window.open(). It seemed to be working fine, right up until a had a drop down list to close to the bottom of the page, which made it open up, not down, which made the Y position less than zero, so when I selected a value it pops my logout screen if that makes sense. Anybody have any ideas on a better way to do this?

VB Code:
  1. <script language="javascript">
  2.             function HandleOnClose(){
  3.                 if(event.clientY < 0){
  4.             window.open("UnloadPage.aspx");}
  5.             }
  6.         </script>
  7.     </HEAD>
  8.     <body onbeforeunload="HandleOnClose()" bgColor="#000000">

 

Error trapping coding -
I want to know how you guys do error trapping... What if I got two private sub that need the same error trapping routine... I have to code the same trapping code on two subs. Is there a better way like one place can call trapping code in another sub. Thx


Disable back button on browser and also close browser -
Hey guys, Does anyone know how to disable the back button on the browser? Also, does anyone know how to close the browser programatically? I would like to push a button and that event would close the browser. Any help would be awesome Patrick


How to trapping the F1 key in IE/ActiveX -
I have an ActiveX application that has content sensitive help. My problem is preventing IE's help from displaying when F1 is pressed. When the application is running in the browser and a control in the app has the focus pressing the F1 key displays both the application's help topic a


closing a browser -
Hello everyone Please I need help. I am writing some asp pages and it must be tested in Nestscape and IE. One of the active server pages has a image that said [ Close Browser ]. Questions: I am looking for a code in VBScript to close the browser. If not, Can you guide


Log out users when they close browser -
im creating a browser app where the user logs in. I have a log out button to log them out but what if they just close the browser without logging out properly. is there a way of logging them out when they have closed the browser??? thanks


session onEnd -
will session_onEnd trigger when the user close the browser? if so how can i handle events when the browser is close? i've tested that session_noEnd event do trigger when the browser was closed, but in some instance or perhaps using another workstation/pc when the browser was clo


[2005] Web browser error -
Hi, I have a web browser control that accesses a web page and when the user clicks on the close window link in the webpage the web browser displays a message saying: "The webpage you are viewing is trying to close the window. Do you want to close the window?" If you sa


Close New_Window2 -
Ive created a web browser in VB6. When a new window is targeted, a new instance of my browser appears. If a link is clicked on a page that closes a window in JavaScript(Window.close), my web-browser control turns black but my form remains on the screen. How do I close this window wh


Proramatically remove lines of code -
In this $#@$$ project I have "inherited," there are some lines of code that repeat themselves in every single function, subroutine and module that I want to get rid of.... actually, they're code for an old fashioned way of doing some error trapping. I want to get rid of them


close browser -
This may be sort of a newbie question but what the hek. How can i close the the current browser on the click of a link?


vba error trapping for classes and forms -
with modules you can set up the error trapping code in the first module and it's valid for all subsequent modules. unfortunately the same is not true of forms and classes which appear to require error trapping code in every procedure within them. is there any way round this?


closing browser -
Hello, I want to add a link to my page "close the browser", when the user clicks on that link, it will close the browser. Is there an easy way in c#?


tabbed browser... -
im trying 2 build a web browser can annyone help me ..? can annyone send me a tutorials made for web browser on wen a button is clicked an extra tabed browser 2 be oppened i mean a multiple tab windows... and thair close buttons..? f annyone can guide me on this would b


ASP.Net Close Browser -
Is there any way to close the browser using ASP.Net on the client side? Thanks, Squirrelly1


error trapping -
Hey, can someone give me the simplest example of error trapping? if there is no simple example, no prob. thanks


trapping the arrow keys -
I need to know when an arrow key has been pressed but I can't locate the code to use for trapping them.


Error trapping in VB sucks -
Exit Sub is such a dumb way to do error trapping. Exceptions are infintely better.


Web Browser Running for one hour Problem -
It seems that after running my web browser form filler program for a whole hour...then it starts having problems...like its not filling the pages anymore...but when i close it and reopen it it works for another hour. instead of closing my program and reopening it?... Is there a way i c


[2005] How do you clear cache objects on browser close -
How do you clear cache objects when the user exits the browser? I currently have code to do this is the global.asax page's session_end event, but it doesn't seems to fire on browser close. Would the application_end event work?


Close a browser window... -
Is there any way to close/kill an entire browser window (frames and all) from a frame? Without using "top.parent.window.close" which gives a standard confirmation box (a little unprofessional...)


Key Trapping in a Textbox. -
Hello, I have a Textbox on a form that I type text into, I need the 'Return' and 'Enter' keys on the keyboard to be disabled when entering text. I know using key trapping will work but I am not sure how to code it, Any ideas, SKM.


trapping mouse in picture box -
How would i go about trapping the mouse inside the picture box that i am drawing a line in? I have absolutely no idea how to do this. If someone could give me some pointers i would really appreciate this.


Tracking and logging errors in code -
In a project I "inherited," there is little if any error trapping / recording. The project has about 25,000 lines of code. I was wondering if any of you wise folk out there might have a sample of code for error trapping and writing to an error log, or if you would kindly po


Error handling in general -
When I creating a program, I will typically do not include any OnError statements until the program is nearly finished. I do this primary to avoid the temptation of relying on error handling to do certain tasks. For example I could use error trapping make sure an integer generated fro


[2008] Launch browser with button click -
I am very new at VB, using VB 2008 Express. I have created a very simple splash window (form) which will reside on a CD and autorun. It contains one button which should launch the index.htm file from a folder on the same CD. I have searched through help in VB which I find poor, and on


error trapping question -
how does VB error trapping work?


toggle IE browser -
Say I launched an IE browser, then I ran my code. I want my IE to be always "the first" IE instead of the previous IE, is there a way to do that? my code some how only gets the process ID from the first IE browser, so I am trying to generate a "dummy" IE and take it


[2005] Drop logged in sessions with the browser control -
I'm looking for a way to programatically drop every current "logged in" session in my browser app (using the COM browser from net 1.1). To clarify what i mean, here's an example: If I am logged in to my gmail webmail with my browser, and run the code described above, i shoul


[2008] Make my webbrowser default browser -
I made a browser called as Icy Memory Browser with tab feature. One of my question is how am i suppose to make this browser an option to be the default windows browser. And is there a code for Visual Basic to check if the browser is set as default browser at the start of the prog


Web Browser Control Pop up problem -
Every time i close my web browser program i get a pop up......the page im on has some javascript pop up....is there anyway i can stop that from happening...i know there are ways to stop pop ups while your program is running but what about after you close it? thanks in advance


VS 2005 VB.NET : Web Browser Help Needed -
Hi guys i am having a window form, within the form, i have 2 part, the upper part is a datagridview and the lower part is a web browser (control name :wbBroser). the situation is this: when i double click a cell on the datagridview, the web browser will display a web page content


Closing browser -
Guys, How do you get hold of the close event on the browser? I have an aspx based app that applies some datatbase locking, which is easy to manage with user events within the application, but if they decide to close the browser while they still have records locked it fails. I was


Browser window close event -
Hello everybody, I need to execute some code when user closes the browser window. Is this possible to catch the browser window close event and execute some code before exiting the application ? Thanks.


window.close -
I have a button on a form that when clicked I want to close the browser, the browser will always be IE. Here is the code I've got, Code: <form action="javascript:null"> <input type="button" value="Close this window" onclick="window.cl


Trapping arrow keys -
Hi Andrew, Try trapping the on the KeyDown Event of your Control. Private Sub lstOrderNo_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyDown Then MsgBox "Hey YOu!" End If End Sub ThoMas.


On Error ---Error (RESOLVED) -
Hi I have an application that cycles through about 50 remote MSDE databases, to download data, problem is, sometimes the machines are on, and sometimes not, and the whole comms area is a bit flaky. I put 'on error' trapping in the pgm with 'err.reset' and this handles the first non


close current browser window -
Hi, How can I close the current browser window after user click the button? I know Javascript "window.close" can do so, but is it possible to do it in ASP .NET? Regards, Calvin


How to disable close button of the browser -
Hi all, please help. I am working on an ASP.NET web program with VB.NET. Is there any way to disable/remove the close button on the top right corner of the browser (IE 6.0)? Thanks a lot, xihu24


Error trapping problem -
Hi I have made a 'database corruption utility' tool for our customers to use to determine which records in a specific table are corrupted (as happens often with access). My program creates a temporary table in a new database, and copies all data from the source table to the new one


Trapping the close button -
hi, can we trap the clicking of close button of a vb form. if so can even trap the alt + f4 command. my main prob is i want to display the msgbox before closing the project. so that by clicking the ok button it has to close if they click cancel nothing should happen. i tried to w