PreviousNext

Why You Should Use View Components, not Partial Views, in ASP.NET Core

by elmira_dam, 2018-08-29T13:38:07.867Z

Why use View Components and not Partial Views? The biggest reason is that when inserting a Partial View into a Razor page, all the ViewData associated with the calling View is automatically associated with the Partial View. This means that a Partial View may behave very differently on one Razor page than on another. With View Components, you control what gets shared to your View Components.

Read More