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();
}
Loading
viet vo quocPosted Oct 31, 2011, 11:31 PM
I hope have much explanation from you or someone know it.Thanks!!
Dipal ChoksiPosted Oct 31, 2011, 10:57 PM