Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET jQuery VB.NET
Hi,
 
I would just like to know if it's possible to list all users who accesses a certain page on a website?
 
Advance thanks to all.
Neoral
Posted 6-Feb-13 20:26pm
Comments
Sergey Alexandrovich Kryukov at 7-Feb-13 1:33am
   
What is "who accessed"? If a user loaded a page and closed it, nothing tells you that she/he is not "accessing" it anymore... Who do you call a user? If you have authentication, it's clear, in other cases, you know nothing about the user, only IP, which can be dynamic. So...
—SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Please see my comments to the question. You should understand, not quite possible, unless you do authentication.
 
[EDIT]
 
If the user is authenticated, it makes more sense.
 
Still, it would be much better to detect access to your site (log in, log out). Imagine the user loads another page not closing the page you are counting. Is the page in question left or not? You cannot detect activation of the pages, as this is not an event visible to the Web application.
 
In principle, you can only detect of the user tries to close the page, handling JavaScript event onunload and sending HTTP request to the site using Ajax:
http://www.w3schools.com/jsref/event_onunload.asp[^].
 
—SA
  Permalink  
v2
Comments
neoraltech at 7-Feb-13 1:54am
   
Hi Sergey,
 
Thanks for your prompt response.
 
The user is authenticated since all users would undergo a login first before they can use the web application.
 
Thanks.
Neoral
Sergey Alexandrovich Kryukov at 7-Feb-13 8:39am
   
Good. It makes a lot more sense. Please see my updated answer above, after [EDIT].
—SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Please follow below steps...
 
1. Decide in which pages u want to track users
2. Understand the scenario how it should works
3. U should Know how session works
 
Now in Page_Load() you have to check is there anyone logged in your application through session..
 
if (Session["useremail"] != null)
        {
            //code to save user information
        }
        else
        {
            // redirect to login page
        }
 
Here Session["useremail"] stores logged in user details. So if this session exists save the user information like emailid, registration no etc along with page name ( save in database or XML file etc. ). You you will get list of users accessing particular pages.
 
....
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

If you are trying to find out who accesses a page in the past, you can use LogParser to query the IIS Web Logs to see who accessed the URL. This is possible because you have forced the user to login. The Web Logs have columns for both the URL and the UserID.
  Permalink  
Comments
neoraltech at 8-Feb-13 2:12am
   
Will this have a performance problem for the website? I mean, will it slow down the website when it comes to accessing pages?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

It's simple
Decide yourself first whether you want to store the information of the user who access your website (or) want to know who is accessing a particular page in the website.
 
If you want to know the users who are accessing the entire website use APPLICATION STATE technique, if not go for SESSION STATE
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 378
1 OriginalGriff 230
2 DamithSL 200
3 Zoltán Zörgő 149
4 Dave Kreskowiak 120
0 OriginalGriff 7,575
1 DamithSL 5,529
2 Sergey Alexandrovich Kryukov 5,279
3 Maciej Los 4,961
4 Kornfeld Eliyahu Peter 4,539


Advertise | Privacy | Mobile
Web01 | 2.8.141223.1 | Last Updated 7 Feb 2013
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