Click here to Skip to main content
15,917,060 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,


I have one code behind function like below

VB
Private Sub Get()
            Dim test1 As String  
            Dim test As String 
            If test IsNot Nothing Then

                           End If



now i want to call this get() function when user close the web form .

please help me
Posted

Try with this event

VB
Private Sub Form1_FormClosed(sender as Object, e as FormClosedEventArgs) _ 
     Handles Form1.FormClosed

      //call your func

End Sub
 
Share this answer
 
v3
Comments
Pro86 26-Aug-13 8:41am    
i have web form abc.aspx page in my application
for server side page lifecycle function you can do like this.
VB
Private Sub Page_Unload(sender As Object, e As System.EventArgs) Handles Me.Unload
' call your function
    End Sub


but if you close your browser with ALT+F4 it is not going to work.
 
Share this answer
 
v2
Comments
Pro86 26-Aug-13 9:07am    
thanks for your rply
but above event raised before page close

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900