In the new version of MVC, the @ Html.Action () method was removed, how now to call controller methods. Suppose I want to call a method from the NavController from _Layout

    1 answer 1

    In place of the @Html.Action came ViewComponents . They work like, but not exactly the same as @Html.Action .

    For example, in MVC5 and earlier, the execution of 'child actions' also entailed the execution of any filters (for example, if the controller was decorated with some filters) giving them the appearance of ordinary actions

    But this is not the case for ViewComponents . They are executed in the context of the current request.

    Read more about ViewComponents

    translation of the answer @KiranChalla