?
Solved

session_end() of global.aspx does not execute on session.abandon() in vb.net code behind

Posted on 2004-10-07
3
Medium Priority
?
1,032 Views
Last Modified: 2008-02-20
hello everybody,

friends i am working on an application where i have to reset a flag in databse by a sql query whenever the session of a user is destroyed due to timeout or proper logout, so i used session.abandon() command in vb.net code behind and write the following code in session_en() function of global.aspx .


-----------------------------------------------------------------------------------------------
 Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)

        Dim connLogin As SqlConnection = New SqlConnection
        connLogin = New SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"))
        If connLogin.State = ConnectionState.Closed Then
            connLogin.Open()
            Dim x = 17 'Session("IID")
            Dim cmdUpdate As SqlCommand = New SqlCommand("update status set Flag='1' where IID='" & x & "'", connLogin)
            cmdUpdate.ExecuteNonQuery()
            connLogin.Close()
            Context.Response.Write("database restored")
        Else
            Context.Response.Write("database cant be restored")
        End If

End Sub
-----------------------------------------------------------------------------------------------------

but any part of this function is not executed at all whenever session expires.

i have also given the session timeout value to 2 minutes in web.config file.

please help that exactly when and how this function can be executed as i need it at many more places.

thanks in advance.
0
Comment
Question by:anugrah
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 33

Expert Comment

by:raterus
ID: 12248209
0
 

Accepted Solution

by:
softsolvers earned 360 total points
ID: 12256024
you can't see any context.response.write("string ")   output in session_end() otherwise your function is working fine . i have checked it .

thanks
0
 
LVL 1

Author Comment

by:anugrah
ID: 12256033
ya , softsolvers , thanks a lot your soluted helped me out of your problem
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month12 days, 6 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question