Where is @Html.Action in Asp.net Core? I can see @Html.ActionLink but not a direct call to an Action as before.
@Html.Action
@Html.ActionLink
Was it replaced by ViewComponents?
Yes, ViewComponents would be the new way of doing this, but they are not exactly the same as what @Html.Action was doing before though...for example, in MVC5 and prior, invoking 'child actions' would also execute any filters (for example, if the controller had filters decorated on them) giving them the appearance as regular actions...but this is not true with ViewComponents and they are executed in the context of actual request...
More info on view components: https://docs.microsoft.com/en-us/aspnet/core/mvc/views/view-components
1.4m articles
1.4m replys
5 comments
57.0k users