VisualStudioFeeds

All Visual Studio blogs in one place

AddThis Social Bookmark Button
        Introduction:                       ASP.NET MVC 4 comes with a bunch of new features including lot of features for mobile. Mobile features include Mobile Optimized Project Templates, Display Modes, View Switcher, Browser Overriding, etc. In addition to these features, you may need to use different host for mobile and desktop because lot of sites uses a different host name for mobile and desktop. For example, twitter.com uses mobile.twitter.com host name for mobile and facebook.com uses m.facebook.com host name for mobile. In this article, I will show you how to use different host name for desktop and mobile.           Description:                       First of all you need
create a new ASP.NET MVC 4 application. Then, create a new RequestSwitcherAttribute.cs file and add the following lines in this file, public class RequestSwitcherAttribute : ActionFilterAttribute { string desktopHost, mobileHost; public RequestSwitcherAttribute(string desktopHost, string mobileHost) { if (string.IsNullOrWhiteSpace(desktopHost)...(Read whole news on source site)

Search

Subscribe

Enter your email address:

Delivered by FeedBurner

Increase your website traffic with Attracta.com

Contact

Email:
Subject:
Message:
Anti-spam: How many eyes has a typical person?

Follow us on FB

Home : Blog List : Imran Baloch's Blog : Switching between Mobile and Desktop Host in ASP.NET MVC 4