找出MVC中的命中数 [英] Find out hit count in MVC

查看:62
本文介绍了找出MVC中的命中数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI


我有一个页面,根据类别有几个视频。我想找出特定视频在页面中被点击的时间。任何建议或想法。

解决方案

您可以拦截对global.asax中静态和非静态内容的请求,或者实现托管处理程序/过滤器。

如果您正在通过动作提供视频,您可以简单地将计数逻辑放在那里。正确的解决方案还取决于您使用的IIS版本和asp.net版本。

请阅读以下两篇文章:

http:/ /blogs.msdn.com/b/tmarq/archive/2010/04/01/asp-net-4-0-enables-routing-of-extensionless-urls-without-impacting-static-requests.aspx [ ^ ]

http://msdn.microsoft.com/en-us/library/ff649096.aspx [ ^ ]

[更新]

关于IIS的一般视图处理管道也很有用: http://www.iis.net/learn/get-started/introduction-to-iis/introduction-to-iis-architecture [ ^

HI
I have a page which has got several videos based on the category.I wanna find out number of time a particular video has been hit in the page.Any suggestion or Idea.

解决方案

You can intercept requests to static and non-static content in global.asax or by implementing a managed handler/filter.
If you are serving the videos from an action you can simply put the counting logic there. The proper solution also depends on the IIS version and the asp.net version you are using.
Please read these two articles:
http://blogs.msdn.com/b/tmarq/archive/2010/04/01/asp-net-4-0-enables-routing-of-extensionless-urls-without-impacting-static-requests.aspx[^]
http://msdn.microsoft.com/en-us/library/ff649096.aspx[^]
[Update]
A general view on the IIS processing pipeline can be also useful: http://www.iis.net/learn/get-started/introduction-to-iis/introduction-to-iis-architecture[^]


这篇关于找出MVC中的命中数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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