[英]Razor Pages ASP.NET tag helpers not redirecting not generating ref correctly (asp.net core 2.1)
在更新我的应用程序以使用MVC的ASP.NET Core 2.1中的剃须刀页面结构时,我的某些链接停止了工作。
基本上-做asp-page="Example"
,生成的代码将是
site?page=Example
装的
site/Example
尝试使用asp-controller,asp-area和任何其他taghelper时会发生这种情况 ,与asp-page示例中的相同
这仅在特定页面上发生-恰好是“主页/索引”页面。
这是Startup.cs中的相关部分
ConfigureServices:
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
配置:
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.