Summary

This chapter was a whirlwind tour of Ajax features in ASP.NET MVC 4. As you now should know, these features rely heavily on the open source jQuery library, as well as some popular jQuery plugins.

The key to success with Ajax in ASP.NET MVC 4 is in understanding jQuery and making jQuery work for you in your application. Not only is jQuery flexible and powerful, but it allows you to separate your script code from your markup and write unobtrusive JavaScript. The separation means you can focus on writing better JavaScript code and embracing all the power jQuery has to offer.

This chapter also looked at using client-side templates and serving JSON from a controller action. Although you can produce JSON from a controller action easily, you could also use the Web API to serve JSON. Web API includes some additional features and flexibility when it comes to building web services that produce data. We'll talk more about the Web API in Chapter 11.

Get Professional ASP.NET MVC 4 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.