© Adam Freeman 2020
A. FreemanPro ASP.NET Core 3https://doi.org/10.1007/978-1-4842-5440-0_24

24. Using View Components

Adam Freeman1  
(1)
London, UK
 
I describe view components in this chapter, which are classes that provide action-style logic to support partial views; this means view components provide complex content to be embedded in views while allowing the C# code that supports it to be easily maintained. Table 24-1 puts view components in context.
Table 24-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 HTML or JSON data into a parent view.

Why are they useful?

Without view components, it is hard to create embedded ...

Get Pro ASP.NET Core 3: Develop Cloud-Ready Web Applications Using MVC, Blazor, and Razor Pages 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.