隐私权|发布在MVC [英] HitCounter in MVC

查看:105
本文介绍了隐私权|发布在MVC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图建立在ASP.NET MVC的网站的不同部分点击计数器 - 任何想法,最好的地方,这样做会是这样,还是一个很好的办法做到这一点?我们想跟踪有多少点击网站的各个部分得到的。

I'm trying to build a hit counter for different parts of the website in ASP.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:


  • 您可以实施<一个href=\"http://msdn.microsoft.com/en-us/library/system.web.mvc.actionfilterattribute.aspx\">ActionFilterAttribute它记录命中一些商店。

  • 您可以从<一个派生href=\"http://msdn.microsoft.com/en-us/library/system.web.mvc.defaultcontrollerfactory.aspx\">DefaultControllerFactory和记录命中为每个请求的控制器。

  • 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.

这篇关于隐私权|发布在MVC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆