473,387 Members | 1,925 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.

Session end event fires but it is not executing code

I am trying to delete a file from a disk when the user's
session ends. So I am putting my file.delete code in
Session_End event. I ran the application in the debug
mode. When the session timesout session event is firing
but it is not executing any of my delete code. Can
somebody tell me what I am doing wrong?

Thanks in advance
Nov 17 '05 #1
4 7402
If you are using session mode other then InProce, session_end will not fire.

If you are usnig inproc - then how do u know it's firing if your code is not
being executed?

Also, posting the code would be helpful.

"Sampriti" <su*****@mailcity.com> wrote in message
news:0f****************************@phx.gbl...
I am trying to delete a file from a disk when the user's
session ends. So I am putting my file.delete code in
Session_End event. I ran the application in the debug
mode. When the session timesout session event is firing
but it is not executing any of my delete code. Can
somebody tell me what I am doing wrong?

Thanks in advance

Nov 17 '05 #2
how do you know the Session_End event is firing? If your delete code is
correct, and works, and the session_end event is firing, and your delete
code is called in session_end, then there isn't a reason for it not to work

unless, you don't have permission to delete the file? Did you step into it
and verify that the delete code is running?

"Sampriti" <su*****@mailcity.com> wrote in message
news:0f****************************@phx.gbl...
I am trying to delete a file from a disk when the user's
session ends. So I am putting my file.delete code in
Session_End event. I ran the application in the debug
mode. When the session timesout session event is firing
but it is not executing any of my delete code. Can
somebody tell me what I am doing wrong?

Thanks in advance

Nov 17 '05 #3
What Console are you trying to write to?

Instead, try logging the beginning of Session_End to a database or
something. Make sure it is executing.

"sampriti" <su*****@mailcity.com> wrote in message
news:05****************************@phx.gbl...
This is how I know my session end event is firing
1.I have put break point on first line of code in
session_end event.
2.when the event fires the breakpoint which is red
initially turns yellow.
3.When I click stepInto nothing happens and breakpoint
turns red.
Here is my file delete code in session_end event of my
global.asax file
string strSessionDatasetFile = Server.MapPath
("~/SearchXML/"+Session.SessionID+".xml");
FileInfo fi = new FileInfo(strSessionDatasetFile);
if(fi.Exists)
{
// delete the file
try
{
fi.Delete();
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}

}
-----Original Message-----
If you are using session mode other then InProce,

session_end will not fire.

If you are usnig inproc - then how do u know it's firing

if your code is not
being executed?

Also, posting the code would be helpful.

"Sampriti" <su*****@mailcity.com> wrote in message
news:0f****************************@phx.gbl...
I am trying to delete a file from a disk when the user's
session ends. So I am putting my file.delete code in
Session_End event. I ran the application in the debug
mode. When the session timesout session event is firing
but it is not executing any of my delete code. Can
somebody tell me what I am doing wrong?

Thanks in advance

.

Nov 17 '05 #4
Rad
(insufficient) permissions on the file..
"Sampriti" <su*****@mailcity.com> wrote in message
news:0f****************************@phx.gbl...
I am trying to delete a file from a disk when the user's
session ends. So I am putting my file.delete code in
Session_End event. I ran the application in the debug
mode. When the session timesout session event is firing
but it is not executing any of my delete code. Can
somebody tell me what I am doing wrong?

Thanks in advance

Nov 17 '05 #5

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

Similar topics

13
by: Manuel Lopez | last post by:
I have a puzzling form timer problem that I didn't experience prior to Access 2003 (though I'm not sure access 2003 is to blame). Here's the situation: a computer has two access 2003 databases on...
3
by: Jeff Smythe | last post by:
I simply want to execute some code once when a new session of my ASP.NET application is started (I'm not using session state for anything else - just writing some data to a database). I thought...
8
by: Paul | last post by:
Hi, In a class i built, i fire an event when a field changes. In a webform that has an instance of the class, the event (from the class) is fired and the code is executed. However, my webpage...
6
by: Patrick Olurotimi Ige | last post by:
I'm tracking usersOnline by adding this code below in my Global.asax file.But i noticed that when a user logs in it keeps adding a new user which thats fine..but when a user logs of it still...
5
by: news.microsoft.com | last post by:
Hi everyone, I need some help (may be in the form of some sample code) for the subject question. I have an ASP.NET/C# application. I need to do quite a few tasks when the session ends. I...
5
by: Sean | last post by:
Problem with sessions I have created an application without concern for sessions. As it turns out I think that might be my undoing. What I have: I have an online quiz. I don’t need to know...
5
by: news.microsoft.com | last post by:
We are logging many events on our application but cant seem to discover how to determine who the user was in the session end event, as any session storage seems to have disapeared at the point at...
11
by: David Thielen | last post by:
Hi; Is there some kind of session ID variable that I can get in the code behind and that is available in Session_OnEnd() to know what session ended? -- thanks - dave...
6
by: Marcus | last post by:
I have an ASP.Net 2.0 app that needs to jump out onto another web server running a java server page website (Apache TomCat 4.1.12) that I control. I hate that it needs to do this, but we are using...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.