?
Solved

Where to redirect a MVC site to mobile views

Posted on 2012-03-10
2
Medium Priority
?
276 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

777 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