dotnetspider.com
Login Login    Register      

TutorialsForumCareer DevelopmentResourcesReviewsJobsInterviewCommunitiesProjectsTraining

Subscribe to Subscribers
Talk to Webmaster
Tony John

Facebook
Google+
Twitter
LinkedIn
Online MembersPhagu Mahato
More...
Join our online Google+ community for Bloggers, Content Writers and Webmasters




Forums » .NET » ASP.NET »

How to track visitors in my website


Posted Date: 15 Jun 2012      Posted By:: swamy     Member Level: Bronze    Member Rank: 1758     Points: 1   Responses: 3



Hi,
in my website have more pages but i count particular or some(individual) pages visitors count and web sit visters




Responses

#675624    Author: Ultimaterengan        Member Level: Gold      Member Rank: 9     Date: 15/Jun/2012   Rating: 2 out of 52 out of 5     Points: 4


using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
Application.Lock();
if (Application["VisitorsCount"] == null)
{
Application["VisitorsCount"] = 1;
}
else
{
Application["VisitorsCount"] = Convert.ToString(Convert.ToInt32(Application["VisitorsCount"].ToString()) + 1);
Application.UnLock();
Response.Write(Application["VisitorsCount"].ToString());
}
}
}
}




Thanks & Regards
G.Renganathan
Nothing is mine ,Everything is yours!!!


http://renganathan1984.blogspot.com/



 
#675636    Author: Pawan Awasthi      Member Level: Diamond      Member Rank: 4     Date: 15/Jun/2012   Rating: 2 out of 52 out of 5     Points: 2

Hai Swamy,
To get the number of users who has hit your application, you need to write the application level events in the Global.asax file.
The Application_Start event can be used for getting the application level information- like total number of users hit your website, to change the banner of the website on particular day etc.
To get the user related information, you need to write the Session_Start event where each user will have a separate session. So you can get the user specific information from Session-Start event and use the Application_start event to display all the user details to all the users at the application level.
Hope it will be helpful to you.

Regards,
Pawan Awasthi(DNS MVM)
+91 8143683708 (pawansoftit@gmail.com)
Outstanding Contribution Award..NTT Data Inc



 
#675648    Author: swamy      Member Level: Bronze      Member Rank: 1758     Date: 15/Jun/2012   Rating: 2 out of 52 out of 5     Points: 1

thanks





 
Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.



Next : I have a .ocx control which can be added to toolbox when i create a window application but
Previous : Authenticated Login Page in C#
Return to Discussion Forum
Post New Message
Category:

Related Messages



Follow us on Twitter: https://twitter.com/dotnetspider

Active Members
TodayLast 7 Daysmore...

Awards & Gifts
Email subscription
  • .NET Jobs
  • .NET Articles
  • .NET Forums
  • Articles Rss Feeds
    Forum Rss Feeds


    About Us    Contact Us    Copyright    Privacy Policy    Terms Of Use    Revenue Sharing sites   Advertise   Talk to Tony John
    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
    2005 - 2012 All Rights Reserved.
    .NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
    Articles, tutorials and all other content offered here is for educational purpose only.
    We are not associated with Microsoft or its partners.