Doubt Related to Web Browser Events

Results 1 to 2 of 2

Thread: Doubt Related to Web Browser Events

  1. #1
    Join Date
    Dec 1969

    Default Doubt Related to Web Browser Events

    &nbsp;<BR> I have a browser(IE) and I displayed one form over there.<BR><BR> I have to execute some statements at the time of that browser is closed.<BR><BR>Plz find a solution in VB.Net<BR><BR>My Exact Question is given Below<BR><BR>How to capture the Window close event in VB.NET?

  2. #2
    Join Date
    Dec 1969

    Default RE: Doubt Related to Web Browser Events

    VB.Net has nothing to do with the processing on the client browser, is a server side technology. If you want to to do something back on the server when a user closes a window or leaves a page then you will need to use javascript in the page onunload event. Its pretty easy just caz a post back to the server passing the info that u need and do the processing. Just remember that u are not going to be returning a response to the client when a postback of this kind happens and terminate it. Otherwise if the user just went to another page your response is going to take them back to your page and tick them off.<BR><BR><BR>&#060;body onunload="myUnLoad()"&#062;&#060;form id="myForm" method="post" runat="server"&#062;<BR><BR>&#060;script language=javascript&#062;<BR>&#060;!--<BR>function myUnLoad(){<BR>document.myForm.submit();<BR>}<BR>//--&#062;<BR>&#060;/script&#062;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts