Hi,
u can use Application level variables and make use of the events in Global.asax
Steps:
1. Declare Variables
private static int totalNumberOfUsers = 0;
private static int currentNumberOfUsers = 0;
2. Add Properties
public static int TotalNumberOfUsers
{
get
{
return totalNumberOfUsers;
}
}
public static int CurrentNumberOfUsers
{
get
{
return currentNumberOfUsers;
}
}
3. Session Start Event
protected void Session_Start(Object sender, EventArgs e)
{
totalNumberOfUsers += 1;
currentNumberOfUsers += 1;
}
4.Session End Event
protected void Session_End(Object sender, EventArgs e)
{
currentNumberOfUsers -= 1;
}
5.Access variables from other page
int currentNumberOfUsers = HitCounters.Global.CurrentNumberOfUsers;
int totalNumberOfUsers = HitCounters.Global.TotalNumberOfUsers;
Refer
http://imar.spaanjaars.com/223/howto-create-a-hit-counter-using-the-globalasax-file-in-aspnet-1x[
^]
:thumbsup: Revert for further clarification