开发者

Is a ASP.NET MVC controller action faster/more efficient than a HttpHandler?

I'm trying to create a simple lightweight server side redirect which inspects the client's User-Agent and redir开发者_开发百科ects to a website for a given browser. For example:

if(Request.UserAgent.contains("Firefox") { //redirect to www.yahoo.com }
else if(Request.UserAgent.contains("Safari") { //redirect to www.google.com }
else { // redirect to www.msn.com }

What would be the most performant/efficient way of accomplishing this using asp.net?


No. Controllers implement IHttpHandler behind the scenes and use reflection to execute action methods.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜