Hacker Newsnew | past | comments | ask | show | jobs | submit | SwearWord's commentslogin

You guys are so cool.


Bazynga


All my dreams are coming true. Great work guys.


Stop telling me what to do HN!


Oh man do I feel more and more pushed to upgrade our codebase to MVC4...


I'm curious, is there something specific in MVC4 that you need? Personally, I just want it for WebAPI.


Two of the main reasons are Display Modes and TAP support.

Also, you don't need ASP.NET MVC 4 to use ASP.NET Web API. Just install Microsoft.AspNet.WebApi package into your existing ASP.NET MVC 3 project, you will be good to go. Just be careful for the order of routes. Both ASP.NET MVC and Web API routes collected under the same collection and a request may go into another pipeline rather than intended one if routes aren't set up properly.


The automatic support for routing to .mobile views is really nice, for one thing.

The small improvements to Razor (e.g. automatic ~/ parsing and conditional shortcuts) are also nice time/trouble savers.


I've been following MVC for a long time and I somehow completely missed the .mobile.cshtml feature! I can actually make use of this now. Thanks :)


The .mobile.cshtml is included out of the box, but you can also define other specific display modes with a lambda expression:

DisplayModeProvider.Instance.Modes.Insert(0, new DefaultDisplayMode("iPhone") { ContextCondition = (context => context.GetOverriddenUserAgent().IndexOf ("iPhone", StringComparison.OrdinalIgnoreCase) >= 0) });

After calling that, you can create a view (index.iphone.cshtml) and it'll be automatically picked up when the condition's matched. This example uses the user agent, but you can use any logic you'd like - cookie / database call / time of day / whatever.


Very nice! What's the best way to develop and debug mobile sites locally? Is there a quick way to force either my browser or VS to go into 'mobile' mode?

Edit - Found the answer :) http://www.howtogeek.com/113439/how-to-change-your-browsers-...


Right it's the average a single app makes that matters, the heavy hitters like Rovio can make up for your dime a dozen fart apps.


Well Apple's content (iTunes, App Store) exists mostly to move their hardware.

Compared to Amazon where the hardware exists to give users access to content.

Explains some of the price differences between the devices.


A few of the Bukkit developers were hired by Mojang to work on the official API.


Wait, there are other Microsoft developers?


This is the best js tutorial I've seen in a while


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: