Where to redirect a MVC site to mobile views

I am working on upgrading a classic ASP site to MVC with C# and want to support mobile devices with custom views. I have found www.handsetdetection.com from another thread. They have sample code about using the various methods, but no examples of how to integrate it into a MVC site.

1. Where is the best place to detect the device and perform the redirection? Do I need to do it for every page?

2. In their examples, it shows a request object. I'm not sure how to go about building it. I'd like to get an example of how to build the request object.
Who is Participating?

Improve company productivity with a Business Account.Sign Up

markmiddlemistConnect With a Mentor Commented:
Have a look at http://dotnetslackers.com/articles/aspnet/Mobile-Device-Detection-and-Redirection-Using-ASP-NET-MVC.aspx

As for (2) you coulr try HttpContext.Current.Request
dgerlerAuthor Commented:
The articles got me thinking. I actually decided to put the detaction in Global.asax in the Session_Start method. Then I set a Session variable and check it for mobile device.

The Request took care of itself in Global.asax.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.