Asp.net core 在ASP.NET 5 MVC6中使用什么代替WebViewPage.RenderPage方法
给出了一个基于旧MVC5的示例: Views/Shared/Index.cshtml-SPA应用程序的视图。它包含一些标记和对布局页面的引用:Asp.net core 在ASP.NET 5 MVC6中使用什么代替WebViewPage.RenderPage方法,asp.net-core,asp.net-core-mvc,Asp.net Core,Asp.net Core Mvc,给出了一个基于旧MVC5的示例: Views/Shared/Index.cshtml-SPA应用程序的视图。它包含一些标记和对布局页面的引用: @{ Layout = "~/Views/Shared/_Layout.cshtml"; } 在_Layout.cshtml中,通过RenderPagehelper使用了许多include: @RenderPage("~/Views/Shared/_ImportCssInline.cshtml") @RenderPage("~/Views/Sh
@{
Layout = "~/Views/Shared/_Layout.cshtml";
}
在_Layout.cshtml中,通过RenderPage
helper使用了许多include:
@RenderPage("~/Views/Shared/_ImportCssInline.cshtml")
@RenderPage("~/Views/Shared/_ImportCssLinks.cshtml")
现在在AspNet5@RenderPage
中,助手不可用。
这是WebViewPage
/WebPageBase
/webpageunderingbase
的方法。现在它们被RazorPage
取代。但是它没有RenderPage
方法
应该用什么来代替
p、 我一直成功地使用了
@Html.Partial(“~/Views/Shared/\u ImportCssInline.cshtml”)
而不是@RenderPage
——我希望对您来说没有使用差异。现在也有这些导入的异步版本
由于Html
属性现在可以作为接口IHtmlHelper
注入,因此我假设在视图的可测试性改进中删除了直接方法