© Adam Freeman 2017

Adam Freeman, Pro ASP.NET Core MVC 2, https://doi.org/10.1007/978-1-4842-3150-0_22

22. View Components

Adam Freeman

(1)London, UK

I describe view components in this chapter, which are a new addition in ASP.NET Core MVC and replace the child action feature from previous versions. View components are classes that provide action-style logic to support partial views, which means complex content can be embedded in views while allowing the C# code that supports it to be easily maintained and unit tested. Table 22-1 puts view components in context.

Table 22-1. Putting View Components in Context

Question

Answer

What are they?

View components are classes that provide application logic to support partial views or to inject small fragments ...

Get Pro ASP.NET Core MVC 2 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.