Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Where to redirect a MVC site to mobile views

Posted on 2012-03-10
2
Medium Priority
?
277 Views
Last Modified: 2012-03-14
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.
0
Comment
Question by:dgerler
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Accepted Solution

by:
markmiddlemist earned 1500 total points
ID: 37705648
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
0
 

Author Closing Comment

by:dgerler
ID: 37720792
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.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question