ASP.Net 5 MVC 6 中的 RenderPartial() 去了哪里?

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

在 ASP.Net 5 MVC 6 中有 Html.RenderPartialAsync 但没有 Html.RenderPartial。进行一些挖掘后,我发现有一个名为 View Components 的新事物,它似乎是部分视图的更强大版本,但适用于动态事物。 MVC 6 是否删除了 RenderPartial 还是我只是没有找到关于它的任何文档?我想用它来将静态导航菜单文件包含到主布局中。

RenderPartial确实不存在于"Microsoft.AspNet.Mvc": "6.0.0-rc1-final"中。但是,它已经实现并且可能会包含在 6.0.0-rc2 中。 https://github.com/aspnet/Mvc/issues/3705.

解决方法是使用 RenderPartialAsync,效果很好。