简体   繁体   English

Asp.Net Core 应用程序不适用于其他领域

[英]Asp.Net Core app not working with other areas

I have published this app which is still under testing.我已经发布了这个仍在测试中的应用程序。 I used the asp.net core identity framework for my security.我使用 asp.net 核心身份框架来保证我的安全性。 When I publish the app without adding other things like dashboard pages, everything works fine and I can route to the /Identity/Account/Manage/index page and see my profile.当我在不添加仪表板页面等其他内容的情况下发布应用程序时,一切正常,我可以路由到/Identity/Account/Manage/index页面并查看我的个人资料。 Now I added a new area called dashboard and created some pages like categories, tags etc. These are all in their respective folders.现在我添加了一个名为仪表板的新区域并创建了一些页面,如类别、标签等。这些都在各自的文件夹中。 This is now the structure of the program这是现在程序的结构
Areas领域
--Dashboard - 仪表板
---Pages ---页面
----Categories ----分类
------index.cshtml ------index.cshtml
------create.cshtml ------create.cshtml
----Tags ----标签
------index.cshtml ------index.cshtml
------create.cshtml ------create.cshtml
--Identity - 身份
---Pages ---页面
----Account - - 帐户

Now Ive deployed the app to this website but it doesn't go to the areas under dashboard.现在我已经将应用程序部署到这个网站,但它没有 go 到仪表板下的区域。 Even the area under identity too does not navigate again.甚至身份下的区域也不会再次导航。 The areas under dashboard are recognized but they just show blank when i navigate to it.仪表板下的区域被识别,但当我导航到它时它们只是显示为空白。 You can use this password and username to login and see what im talking about.您可以使用此密码和用户名登录并查看我在说什么。 Username: OpMainControl Password: room?@awaitcash# This is the website http://www.masterlet.com After you login, you can try navigating to the usual Identity pages like /Account/Identity/Manage or /Account/Identity/Manage/changepassword.用户名: OpMainControl密码: room?@awaitcash#这是网站http://www.masterlet.com登录后,您可以尝试导航到通常的身份页面,例如 /Account/Identity/Manage 或 /Account/Identity/Manage /更改密码。 Or you use the new area i created at /Dashboard/tags and /Dashboard/categories.或者您使用我在 /Dashboard/tags 和 /Dashboard/categories 中创建的新区域。 Ive been trying to manuever this thing for almost 5 days now with no avail.我一直在尝试操纵这件事近 5 天,但无济于事。 Please help!!请帮忙!!

Do you have the Area endpoint in the startup.cs?您在 startup.cs 中有 Area 端点吗?

app.UseEndpoints(endpoints =>
        {
               endpoints.MapControllerRoute(
                name: "areas",
                pattern: " 
  {area:exists=Articles}/{controller=Home}/{action=Index}/{id?}");
               endpoints.MapRazorPages();
          });

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM