Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where did RenderPartial() go in ASP.Net 5 MVC 6?

In ASP.Net 5 MVC 6 there is the Html.RenderPartialAsync but no Html.RenderPartial. Doing some digging I see that there is a new thing called View Components which seem to be a more powerfull version of partial views but are geared toward dynamic things. Did MVC 6 drop RenderPartial or am I just not finding any documentation on it? I want to use it to just include a static navigation menu file into the main layout.

like image 622
Matthew Verstraete Avatar asked Sep 25 '22 18:09

Matthew Verstraete


1 Answers

RenderPartial really does not exist in "Microsoft.AspNet.Mvc": "6.0.0-rc1-final". However, it has been implemented already and probably will be included in 6.0.0-rc2. https://github.com/aspnet/Mvc/issues/3705.

The workaround is to use RenderPartialAsync, it works fine.

like image 146
Ilya Chumakov Avatar answered Oct 11 '22 15:10

Ilya Chumakov