문제

I'm trying to create a simple lightweight server side redirect which inspects the client's User-Agent and redirects 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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top