Click here to Skip to main content
15,903,388 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi,

I have a query, I want to implement counter in my application which is based on user session not on number of user who hit the page. The Session recognizes the users at each and every visit. Whenever a particular user hit the page counter will count his total number of visit based on his session id. Any Ideas...??

I have a slight idea that something needs to be done in the
Session_Start
Event in the Global.asmx file.

I guess something like this[^] should work.

Thanks and Regards,
Anil Chaudhary.
Posted
Updated 8-Nov-11 20:27pm
v3

Hi

I have done the same before but I dont have code snippet available right now with me.

What we have done is
1.Create a table(userID, action,pagename,eventname(you dont need this),date)
2.Each time when user visits the page we will insert a row in db
3.No of rows on a particular date will be the counter of the respective user.


Hope this helps.....
 
Share this answer
 
Comments
Anil Kumar Chaudhary 9-Nov-11 2:28am    
This method will definitively create performance issues. But worth trying...
sriman.ch 9-Nov-11 21:27pm    
Hi Anil

We are using the same code for the past 3yrs and it has no performance impact on our application. Performance depends on how you handle the code right ? But anyway let me check something and if i found any i will post it here. Thanks for your voting.....
Go through this article
<a href="http://msdn.microsoft.com/en-us/library/fxk122b4.aspx">http://msdn.microsoft.com/en-us/library/fxk122b4.aspx</a>[<a href="http://msdn.microsoft.com/en-us/library/fxk122b4.aspx" target="_blank" title="New Window">^</a>]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900