The landscape for .NET developers has seen some exciting changes of late. As you may have already heard, the .NET Framework Core has been Open Sourced. The future of .NET is modular, cross-platform and rather interesting.
ASP.NET vNext leads the way and is a modern modular web framework, written from ground up, for powering the next generation of web applications. Now, you may be hearing a lot of interesting things about ASP.NET 5, like how you can now build and run ASP.NET applications natively on OSX or Linux. But what about the future of regular enterprise web applications built with ASP.NET MVC? What are some key changes to look forward to as MVC 6 rolls around?
In this article I offer an honest simple rundown of the major features that you can start leveraging from the get-go. There’s no code, just helpful resources. So, at the risk of killing you with bullets, let’s summarize what you should be expecting with ASP.NET MVC 6:
Merger of MVC & Web API
- Two prominent citizens of ASP.NET are being merged into one singular framework.
- This helps you write MVC Controllers and Web API endpoints interchangeably.
- The merger eliminates duplicate code and namespace references inside ASP.NET.
- Going forward, the same MVC controllers can serve up HTML markup or data services.
- You can use Dependency Injection in controllers to regulate their behavior.
- Simple POCO controllers in MVC help provide fine grained control.
- Learn more here.
- View Components are similar to partial views, but smarter in separation of concerns.
- Think of them as mini-controllers – they render small chunks of markup instead of a whole.
- They’re great for repeatable features in your web applications, like login controls, shopping carts, tag clouds, etc.
- They derive from the ViewComponent class and use Razor markup.
- View Components are invoked by name and accept parameters.
- Learn more here.
- TagHelpers help you avoid context switching between HTML markup and C# code.
- They are similar to @HTML helpers in previous MVC, but more powerful.
- Instead of server-side ‘@” derivatives, you get to write semantic HTML.
- You can now use custom HTML attributes for client-side elements.
- These special attributes are parsed and understood by the ASP.NET 5 engine.
- Attribute names map to server-side C# methods/properties that get invoked.
- Learn more here, here or here.
- The routing engine you are used to in ASP.NET MVC or Web API gets an overhaul.
- The routing system is now housed in a stand-alone AspNet.Routing NuGet package.
- The routing system normally finds a matching route, creates route data and dispatches a request to the handler.
- Prior to dispatching the request to the handler, the routing system can now use dependency injected constraints for matching MVC route actions.
- The handler can also return control to the routing system, indicating that it cannot handle the request. Instead of an HTTP 404, the routing system will try and match the next route in the route collection. This allows for more flexibility for developers to build up the order of route collections.
- Learn more here.
Demystifying the big “K”
Also, as you prepare for ASP.NET MVC 6, you may be hearing much about the new “K” command line (Powershell or Bash) utilities. The K keyword, by the way, comes from Project Katana – let’s break down the most important usable bits:
- KRE (K Runtime Engine) – This is the all-important engine used to bootstrap and run ASP.NET vNext web applications. KRE includes all the components like a compilation system, SDK tools and native CLR hosts. The best part is – multiple versions of KRE can exist side by side and host ASP.NET applications! Learn more here.
- KVM (K Version Manager) – This utility manages multiple versions of the KRE on a single machine. KVM is used to get KRE in the first place, along with all the necessary dependencies, as well as to upgrade/switch between KRE versions. Learn more here.
- KPM (K Package Manager) – As you know, ASP.NET vNext is a modular web platform and you only use the packages you need for your application. KPM is a package manager used to install and restore all packages required inside your ASP.NET application. Take a look at your
project.json file – it lists all dependencies in your project and KPM manages all packages involved through NuGet. Learn more here.
- The K – Once your ASP.NET vNext application environment is all set, the K* commands serve as the entry point into the runtime to build/run your application. You can fire up the web servers and run your ASP.NET web application through –
k web on Windows or
k kestrel on OSX. Learn more here.
We, at Telerik, are excited about ASP.NET vNext. Between Telerik UI for ASP.NET Ajax and UI for ASP.NET MVC, we got you covered for building/maintaining any type of ASP.NET application for the road ahead. Here are some unique benefits you get by incorporating Telerik UI suites in your ASP.NET MVC applications:
- Polished professional UI – Stop re-inventing the wheel! Telerik ASP.NET suites have been developed over a decade to become a complete toolset with 80+ performant controls for every need. Trust our experience
- Seamless UX – Telerik UI controls, with lightweight HTML5 rendering, look and work flawlessly across major browsers and devices. That’s one huge responsibility immediately off your shoulders! In addition, Telerik suites come with professional skins/themes that you can customize easily.
- Mobile Support And Responsiveness – Yep, your manager wants your ASP.NET web application to work seamlessly on mobile devices, right? We understand mobile and you’ll find a large majority of Telerik ASP.NET controls support responsive behavior to work perfectly on mobile devices of variety of sizes & shapes. I’m talking hard-hitting Line-of-Business-friendly controls like Grid or Scheduler, working effortlessly with full functionality on mobile devices!
- Pace of innovation – With quarterly releases and breakneck speed of development while maintaining quality, you’ll see us innovating continuously. Here are some UI controls added recently – Diagrams, OrgCharts, Map, TreeMap, Gantt, PivotGrid, 10+ HTML5 Charts, Persistence Framework and much more.
Whatever be your next project, Telerik ASP.NET WebForms/MVC controls provide the biggest arsenal of tools to help you build it faster and better!
While you may be hearing a lot of buzz around ASP.NET vNext, just remember – there is something for everybody. The quick rundown of ASP.NET MVC 6 features and the “K” utilities hopefully give you something to cheer about – features immediately usable in your MVC web application projects. And if in doubt, check out our free whitepaper on ASP.NET vNext: 20 Burning Questions, Answered. ASP.NET vNext has a lot of promise – let’s be ready!
Sam Basu is a technologist, author, speaker, Microsoft MVP, gadget-lover and Progress Developer Advocate for Telerik products. With a long developer background, he now spends much of his time advocating modern web/mobile/cloud development platforms on Microsoft/Telerik technology stacks. His spare times call for travel, fast cars, cricket and culinary adventures with the family. You can find him on the internet.