Click here to Skip to main content
15,884,472 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
I want to track all activity of registered user (user already created a account in web application) on a webpage like where he clicked (not a postback event used onclick of anchor), what text he searched (like filter of records etc), how much time spend on a webpage without using any third party tool (try to do this in JavaScript, JQuery, .net using c#). 


What I have tried:

I tried to create a service which called on a page_load event of all pages or may be in master but unable to do clients side events.
Posted
Updated 23-Feb-17 0:50am
v5
Comments
Patrice T 22-Feb-17 3:29am    
"Big Brother" site ?

Yeah, you can't do this from C# code. ASP.NET code runs ENTIRELY server-side. It has absolutely no access to the client at all.

If you're looking for stuff like where on the page a user clicked you MUST use client-side scripting to do it and send that information however you want to whatever logging server you write.
 
Share this answer
 
Comments
chetna2810 21-Feb-17 23:53pm    
Thanks for your response. I got the point. Kindly tell me the way how to do this by using JavaScript or JQuery. I just want to count the no of clicks done.(Ex:- I have used onclick event in anchor).
Also a humble thanks in advance.
Dave Kreskowiak 22-Feb-17 9:03am    
I have no idea how to do it. Client-side script is not my strong suit.
chetna2810 23-Feb-17 2:01am    
Okk Thanks..
As Dave said, you would have to use JavaScript. Theoretically, when your page has loaded you could hook into all the relevant tags and add an event listener to each one (hint JavaScript provides an addEventListener that you would need to use). There are restrictions with this approach though, depending how you hook it up; primarily that you may find that addEventListener listens for events bubbling up (e.g., if you added it to the document to listen for click events), so if something causes the event not to bubble then you won't catch it.
 
Share this answer
 
Comments
chetna2810 27-Feb-17 2:23am    
Thanks for your reply. I will try to use 'addEventListener'.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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