Visual studio feeds

All Visual Studio blogs in one place


Enter your email address:

Delivered by FeedBurner

Increase your website traffic with



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

Follow us on FB


Switching between Mobile and Desktop Host in ASP.NET MVC 4

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, uses host name for mobile and uses 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)

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