Click here to Skip to main content
15,888,803 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi all,
I cannot count user online correctly when using Frame, the number of user online is increase very large amount. Here is my code:
C#
void Session_Start(object sender, EventArgs e)
{
    Application.Lock();
    Application["CurrentUsers"] = (int)Application["CurrentUsers"] + 1;
    Application.UnLock();
}

void Session_End(object sender, EventArgs e)
{
    Application.Lock();
    if ((int)Application["CurrentUsers"] > 0)
    {
        Application["CurrentUsers"] = (int)Application["CurrentUsers"] - 1;
    }
    Application.UnLock();
}

Although it's correct when I use master page.

P/S; My page need to use frame!
Posted
Updated 9-Jun-13 15:49pm
v3
Comments
_Amy 9-Jun-13 23:16pm    
Did you follow the steps?

1 solution

 
Share this answer
 
Comments
Menon Santosh 6-Sep-13 14:19pm    
my + 5
Dholakiya Ankit 7-Sep-13 0:48am    
5+

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