ASP.NET MVC4 Features

ASP.NET MVC4 is the next iteration of Microsoft’s popular Model View Controller framework. MVC3 has been widely adopted and even incorporated in to popular products such as the Open Source CMS Umbraco 5 (Jupiter release).

After watching the video posted by Scott Gu @ I have made my own round up of the cool features

  • Bundling & Minification
    • Instead of <script href=”/Scripts/main.js” you add <script href=”/Scripts”. This will combined all scripts in the folder in to one HTTP request and minify it all. It can also add a unique script to the end causing the bundle to cache for a year, then if any files in the bundle change this will update causing a refresh of the css/js.
    • Coffeesciprt & Less support when registering custom bundles allowing built in transformation from on the server load of these types
  • Extension to razor scripts
    • You can now use the tilde (~) in any html attribute and razor will automatically resolve to the correct URL
    • Conditional attributes eg <div class=”@myclass”>Content</div>. If variable myclass is null or empty the class attribute will not render, works on any attribute making cleaner code
  • WebAPI
    • Allows the building of HTTP APIs that automatically can serialize to the format requested such as xml/json
    • Support oData so that if the returned object support iQueryable parameters can be added to the return to subsets (paging, top n etc)
    • Allows hosting of WebAPI either in an area web, console, service, windows 8
    • Allows results to easily return custom HTTP response codes and location header for querying data
  • Mobile development
    • Supports adaptive rendering using media queries
    •  Allows creation of different mobile specific views
    • Supports mobile templating engines such as jQuery mobile
  • Real time communication
    • Uses SignalR
    • Automatically negotiates the transport (essential using the most optimised form of transportation)
    • .NET way of doing what everyone is using node.js for
    • Allows the server to call JavaScript, e.g pushes a call to the browser thus executing some JavaScript
  • Async keyword
    • As of VS11 support Async keyword to allow more performance and scalability
It looks like we have some really cool features coming our way which will rock, good work guys as usual.

About ScottReed

I am an ASP.NET C# developer working in the south of England current for the south's top digital agency Redweb. I have worked for financial companies, CMS vendors, charities and web agencies tacking a variety of challenges. As part of my jobs and freelance I have done lots of work for high profile companies, big brands and government bodies and worked on some exciting large award winning builds. I love development and enjoy architectural design of software. ScottGu is my .NET hero and the Guru of all thing M$oft