Avatar of David Gerler
David Gerler
Flag for United States of America asked on

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.
ASP.NETASPWCF

Avatar of undefined
Last Comment
David Gerler

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
markmiddlemist

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
David Gerler

ASKER
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.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23