© Adam Freeman 2016

ADAM FREEMAN, Pro ASP.NET Core MVC , 10.1007/978-1-4842-0397-2_22

22. View Components

Adam Freeman

(1)Milton Keynes MK6 3PA, 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 to 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 of ...

Get Pro ASP.NET Core MVC, Sixth Edition 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.