Hello friends,
I want to know the code for how many hits my site currently get.OR How many visitors visits our site.
If anyone found this code please mail me to
Hello friends,
I want to know the code for how many hits my site currently get.OR How many visitors visits our site.
If anyone found this code please mail me to
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Bechir BejaouiPosted Apr 24, 2008, 7:57 PM
create a new integer
in the void Session_Start(Object sender, EventArgs e) even handler add this code
Application("Count",0);
in the void Session_Start(Object sender, EventArgs e) handler add this code
int UserCount = Convert.ToInt32(Application.Get("Count").ToString());
UserCount +=1;
Application.Set("Count",UserCount);
in the in the void Session_End(Object sender, EventArgs e) handler add this code
int UserCount = Convert.ToInt32(Application.Get("Count").ToString());
UserCount -=1;
Application.Set("Count",UserCount);
then go to your page and add a Label and name it lblCount
use this code to get the application visitor in the lblCount
lblCount.Text = Application.Get("UserCount").ToString();