I want to display total visitors visited monthly on vadmin panel ASP.NEt web app.
Loading
I want to display total visitors visited monthly on vadmin panel ASP.NEt web app.
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 attend5days leftRegister
Vishal YelveRank #178 · 13.6K reputationPosted Jan 13, 2023, 4:07 AM EST
Open Global.asax
void Application_Start(object sender, EventArgs e) { // Code that runs on application startup Application["NoOfVisitors"] = 0; } void Session_Start(object sender, EventArgs e) { // Code that runs when a new session is started Application.Lock(); Application["NoOfVisitors"] = (int)Application["NoOfVisitors"] + 1; Application.UnLock(); }On your aspx.cs file
protected void Page_Load(object sender, EventArgs e) { lblCount.Text = Application["NoOfVisitors"].ToString(); }Vikas PanwarRank #1,447 · 1.1K reputationPosted Jan 12, 2023, 8:25 AM EST
Hi ,Please check below url fro more information
Aravind GovindarajRank #430 · 5.8K reputationPosted Jan 12, 2023, 11:09 AM EST
It's vary based on the business use case how and from where we are going to get this data. please find a few options
1. If you opt-in to google analytics, you can get the visitor count from google analytics API.
2. Either keep track of the visit count in DB or XML. Again here we need to check do we need to consider, if the same visitor comes do we need to consider new or old. If you want to consider it as old then take the visitor id from analytics, if you getting the same ignore it in the counter otherwise add +1. On top of this, this logic supposes to be fire and forgot call / async because it shouldn't affect system performance.
Hope this helps you. Thanks