Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: CodeProject
hi
 
i m creata website and i want to show the item view
 
i mean how many times item view online
 
how to do this give me idea please
Posted 20-Jan-11 1:52am
Comments
Hiren Solanki at 20-Jan-11 7:45am
   
If you just want article counter then It's quite easy I think. while fetching article from DB just increase counter and display article.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

That's just keeping a integer field in DB per page.
 
Then put the counter in Globle.Asax file(Hope you're using ASP.Net as you just stated 'codeproject' tag, and it uses ASP.Net too)
 
Inside method
 
Application_BeginRequest()
 
Fetch name of page user requesting for and update counter in DB if you want to store it permanently. otherwise you can use session to maintain.
 
for more information HERE[^] is a mega link for you.
  Permalink  
Comments
Hiren Solanki at 20-Jan-11 7:44am
   
Comment from OP : i am not talking about page view counter i want to article view counter
Nishant Sivakumar at 20-Jan-11 14:36pm
   
To OP: In most cases it would be the same. Unless your article is multi-page, in which case the article-page views will probably be different. And you can't really predict if every reader will actually read every page in the multi-page article.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

You need to maintain the separate count for every article.
 
Refer this
Page Hit Counter using ASP.NET and JScript .NET[^]
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 390
1 Sergey Alexandrovich Kryukov 329
2 BillWoodruff 210
3 Afzaal Ahmad Zeeshan 204
4 CPallini 185
0 OriginalGriff 5,515
1 DamithSL 4,451
2 Maciej Los 3,902
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,175


Advertise | Privacy | Mobile
Web02 | 2.8.141216.1 | Last Updated 20 Jan 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