在 Asp core 3.0 中,当用户点击其个人资料"Areas/Identity/Pages/Account/Manage/_layout.cshtml"时,我的布局页面无法正常工作。
登录后,当我点击默认电子邮件时,我会得到 Manage/Index.cshtml,但没有布局细节。例如导航、忘记密码等链接不显示。我不知道是什么原因导致这种情况。
我将其与其他项目进行比较,并查看任何差异,但找不到布局未显示的原因。
Areas/Identity/Pages/Account/Manage/_layout.cshtml
@{
Layout = "/Areas/Identity/Pages/_Layout.cshtml";
}
Areas/Identity/Pages/Account/Manage/Index.cshtml
@page
@model IndexModel
@{
ViewData["Title"] = "Profile";
ViewData["ActivePage"] = ManageNavPages.Index;
}
Areas/Identity/Pages/Account/_ViewStart.cshtml
@{
Layout = "/Views/Shared/_Layout.cshtml";
}
尝试查看我错过了什么或任何其他检查页面布局的地方。
Profile
,它在_ManageNav.cshtml
中,并且通过在Pages/Account/Manage/_Layout.cshtml
中使用<partial name="_ManageNav" />
进行调用。 - Edward