I am trying to switch to ASP.NET Core from my small ASP.NET MVC 4 application.
In my MVC 4 application, I have a Layout file that uses RenderSection as:
@RenderSection("xyz", required: false)
Then, in my Index file, I have:
@section xyz{
@{Html.RenderAction("abc");}
}
So, I am calling controller action method abc() from Index. The method abc() passes a model object and returns a partial view with that model. I cannot use RenderPartial as it needs a model to be passed.
Now, in ASP.NET Core, I don't have RenderAction() method.
My question is: How would I invoke a controller action method from my Index file? Is there any other HTML helper for that (although I don't see any)?
.
@Html.Action
(I know you are talking about RenderAction but I believe that it follows the same concept) has been replace by ViewComponents. Take a look at: #40341886 . Regards. – Edithe