简体   繁体   English

.net 6 MVC Razor 站点-登录部分链接打不开页面,路由问题? 我怎样才能解决这个问题?

[英].net 6 MVC Razor site - loginPartial links don't open the page, routing issue? How can I fix this?

Basic site from the create project wizard, I added the Identity scaffold like I have done in the past.创建项目向导中的基本站点,我像过去一样添加了 Identity 脚手架。

Added the partial to include the _LoginPartial on my template nav bar.添加部分以在我的模板导航栏上包含 _LoginPartial。 However, the links don't open the page.但是,链接不会打开页面。

在此处输入图像描述

在此处输入图像描述

It stays on the current page and the Areas are there.它停留在当前页面上,并且区域在那里。

在此处输入图像描述

The links look default and I haven't changed them.这些链接看起来是默认的,我没有更改它们。 在此处输入图像描述

If I go to /Identity/Account/Login it renders a 404. Is there any special routing I need to do?如果我将 go 转到 /Identity/Account/Login,它会呈现 404。我需要做任何特殊的路由吗? I thought it does this automatically.我认为它会自动执行此操作。

Have to add app.MapRazorPages();必须添加 app.MapRazorPages(); to the Program.cs到 Program.cs

The app is not smart enough to add when adding the Identity scaffold to the application.将身份脚手架添加到应用程序时,应用程序不够智能,无法添加。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何访问 LoginPartial(.Net Core 2.2)中的自定义 IdentityUser 数据(Img 名称) - How can I access custom IdentityUser data (Img Name) inside the LoginPartial (.Net Core 2.2) 如何在.net核心的剃刀页面中设置全局变量? - How can I set a global variable in razor page of .net core? Razor Pages/ ASP.NET 已部署站点上的核心路由问题(404 错误) - Razor Pages/ ASP.NET CORE Routing Issue on Deployed Site (404 Error) 我在 mvc 索引视图中使用 Razor 页面布局,但我无法调用 Razor pagemodel - I am using Razor page layout in mvc index view but I won't able to call Razor pagemodel Razor 页面路由 - 如何在下一页显示具体数据? - Razor page routing - How to show specific data on the next page? 如何在打开新页面的 razor pages .net core 3.1 项目中向剑道网格添加自定义按钮 - How can i add a custom button to a kendo grid in a razor pages .net core 3.1 project that opens a new page 如何在 Razor Page OnInitialized 事件中使用 404 路由 - How to use 404 routing in Razor Page OnInitialized event Asp.net 核心应用程序问题与 Razor 和 MVC 页面 - Asp.net Core Applications Issue with Razor and MVC Pages 如何为没有 MapGet 的所有 GET 请求配置具有处理程序的 (.net6) WebApplication? - How can I configure a (.net6) WebApplication with a handler for all GET requests that don't have a MapGet? 开始行动:不要在Visual Studio 2017中使用.NET Core打开页面 - Start action: Don't open page with .NET Core in Visual Studio 2017
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM