MVC 6 View Components vs. Partial Views: What is the difference? When should each be used? [closed]

According to this link- https://docs.asp.net/en/latest/mvc/views/view-components

New to ASP.NET MVC 6, view components (VCs) are similar to partial views, but they are much more powerful. VCs include the same separation-of-concerns and testability benefits found between a controller and view. You can think of a VC as a mini-controller—it’s responsible for rendering a chunk rather than a whole response.

So it just a enhancement of partial view and another difference is when you use partial view you still have dependency on controller while in View Component you don’t need a controller. So there is a separation of concern.

There is a detail post for ASP.NET View Components.
http://www.tugberkugurlu.com/archive/exciting-things-about-asp-net-vnext-series-mvc-view-components

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)