Using View Components

You have seen how to create reusable components by using Partial Views, which can be called from any View Pages within your applications, and applied this concept to the top menu of the Tic-Tac-Toe application. But sometimes, even this feature is not enough.

Sometimes you need something more powerful, something more flexible, that you can use throughout your whole web application and maybe even for multiple web applications. That is where View Components come into play.

View Components are used for complex use cases that require some code running on the server (for example, Login Panel, Tag Cloud, and Shopping Cart), where Partial Views are too limited to be used, and where you need to be able to test functionalities ...

Get Learning ASP.NET Core 2.0 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.