使用微软的ASP.NET Javascript Services,可以挑选哪些路由被渲染到服务器端吗?
我需要像主页这样的营销页面在搜索引擎优化服务器上渲染,但网页应用程序页面只在客户端上渲染。
我使用的是react,react路由器和asp net core 2.0。
发布于 2017-12-05 22:34:13
在视图中使用asp-prerender-*,如下所述
例如,在您的cshtml中:
<div id="my-spa" asp-prerender-module="ClientApp/boot-server"
asp-prerender-data="new {
IsGoldUser = true,
Cookies = ViewContext.HttpContext.Request.Cookies
}"></div>https://stackoverflow.com/questions/46527093
复制相似问题