Where is @Html.Action
in Asp.net Core?
I can see @Html.ActionLink
but not a direct call to an Action as before.
Was it replaced by ViewComp
M.R.T2017 said : ... The following examples were successfully tested: ...
First thanks for your sharing.
But this overload method may be cause "HTTP ERROR 500" :
@Html.RenderAction("About")
Because 'controller' maybe lower case controller name, ex. "home", "grid", etc. :
helper.ViewContext.RouteData.Values["controller"]
You need capitalize the controller name, ex. "grid" -> "Grid", because the controller class name is case-sensitive in Assembly, action name is the same.
*Visual Studio 2019/NET Core 2.2.