1

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?

HOCA
  • 1,073
  • 2
  • 9
  • 20

1 Answers1

3

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

Dmitry S.
  • 8,373
  • 2
  • 39
  • 49
  • Any suggestions as to the most performant means of accomplishing the server side redirect? – HOCA Sep 22 '11 at 22:12
  • Implement the IHttpHandler interface in an ".ashx" file and use Response.Redirect inside. Set the IsReusable property to return true. – Dmitry S. Sep 23 '11 at 18:37