HitCounter in MVC
I'm trying to build a hit counter for different parts of the website in 开发者_如何学CASP.NET MVC - any idea where the best place to do this would be, or a good way to do it? We're wanting to track how many hits individual parts of the website get.
Depending on the granularity you want, here are some options:
- You can implement an ActionFilterAttribute that records the hit to some store.
- You can derive from DefaultControllerFactory and record the hit for each requested Controller.
If you are looking for website stats, I would use Google Analytics.
精彩评论