Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
I develop socialportal.   I want to do some thing like how many times a profile of a user is viewed like on this website, the views of a question.
Posted 22-Apr-11 6:13am
om560
Edited 22-Apr-11 6:15am
wizardzz104.9K
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Here's one way to do this:
 
http://madskristensen.net/post/Track-your-visitors-using-an-HttpModule.aspx[^]
 
At a very elementary level you could write a parser for your HTTP server logs.
 
A slightly more involved approach would be to do this in the server side code. There may be existing libraries that help with this. But eventually it comes down to saving the IP address and/or logged-in user profile of the visitor (if you need that info) along with a date-time stamp.
  Permalink  
v2
Comments
Sandeep Mewara at 22-Apr-11 12:17pm
   
My 5!
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

One way would be to set up a process that increments a counter each time the page is opened. You know who the user is so it should be simple to add a column to the user table and update that each time. The rest I leave to you to figure out; this is a very trivial process.
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

You could put something in your master page - I have something in mine that determines the last edited date of the aspx page that's being displayed. It would be a simple task to add a little more code to store this info somewhere (like in a database). My hosting company doesn't allow Httpmodules, so this is pretty much my only option.
  Permalink  
v2

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

  Print Answers RSS
0 OriginalGriff 475
1 Maciej Los 339
2 Richard MacCutchan 225
3 BillWoodruff 219
4 Suraj Sahoo | Coding Passion 155
0 OriginalGriff 8,759
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,639
3 Maciej Los 5,269
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web04 | 2.8.1411028.1 | Last Updated 22 Apr 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100