TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
viet vo quoc
NA
115
105.3k
The session_End method didn't work?Why.
Oct 31 2011 10:33 PM
Hj. I make a counter for my website .It's very plain!!.And when i run website on localhost by much browser ,So it's right.But when i turn off a browser and refresh browser remain .It's not right and i think this is problem from Session_End in global.asax.This is my code .Hope everyone help me about that!
protected void Application_Start(object sender, EventArgs e)
{
Application["person_online"] = 0;
}
protected void Session_Start(object sender, EventArgs e)
{
Application.Lock();
Application["person_online"] = Convert.ToInt32(Application["person_online"]) + 1;
Application.UnLock();
}
protected void Session_End(object sender, EventArgs e)
{
Application.Lock();
Application["person_online"] =Convert.ToInt32(Application["person_online"])-1;
Application.UnLock();
}
Attachment:
test_cookies.rar
Reply
Answers (
2
)
How to add existing page to master page ?
XMLParser in DOT.NET