i want to know the number of hits customers are viewing my website.give me the sample code.
How to know the number of hits
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.
i want to know the number of hits customers are viewing my website.give me the sample code.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Niradhip ChakrabortyRank #429 · 5.8K reputationPosted Apr 15, 2008, 10:54 AM EDT
Check the URL please:
http://www.stardeveloper.com/articles/display.html?article=2002102501&page=1
ajay chigurupati3 reputationPosted Apr 15, 2008, 9:21 PM EDT
Niradhip ChakrabortyRank #429 · 5.8K reputationPosted Apr 17, 2008, 10:54 AM EDT
To make the thing simple. U can refer the following code.
protected void Page_Load(object sender, EventArgs e)
{
Application.Lock();
if(Application["HitCount"]!=null)
{
Application["HitCount"]=(int)Application["HitCount"]+1;
}
else
{
Application["HitCount"] =1;
}
Application.UnLock();
lblInfo.Text="The page has been accessed ("+Application["HitCount"].ToString()+") times";
}
Vijaya KadiyalaRank #1,085 · 1.8K reputationPosted Apr 21, 2008, 7:49 AM EDT
Hi,
Instead of building your own why dont you check out the below link, its easy to integrate.
http://www.easycounter.com/FreeCounter3.html
Thanks -- Vj