Campobets

broken image
broken image

The result it returns, typically a view.The class, typically derived from ViewComponent.A sign in panel that would be rendered on every page and show either the links to sign out or sign in, depending on the sign in state of the user.Tag cloud, where it queries the database.View components are intended anywhere reusable rendering logic that's too complex for a partial view, such as: Is typically invoked from a layout page.Can have parameters and business logic.Includes the same separation-of-concerns and testability benefits found between a controller and view.Renders a chunk rather than a whole response.This article was written using controllers and views, but view components work with Razor Pages. View components don't use model binding, they depend on the data passed when calling the view component. View components are similar to partial views, but they're much more powerful.

broken image