打开 关闭

Default Page related Issue #3043


User avatar
0
kapil 创建

If i want to show other razor page as default page instead of index.cshtml then what should i do?


1 答案
  • User Avatar
    0
    enisn 创建
    支持团队 .NET Developer

    There is a couple of ways to achieve that.

    • You can create a controller that redirects like below https://github.com/abpframework/abp/blob/dev/modules/cms-kit/host/Volo.CmsKit.HttpApi.Host/Controllers/HomeController.cs#L10

    • You can create a new page that handles the"/" path by beginning with @page "/" .

      You can check this out: https://docs.microsoft.com/en-us/aspnet/core/razor-pages/razor-pages-conventions?view=aspnetcore-6.0


    • AspNetCore default routing pattern is {controller=Home}/{action=Index}/{id?}. You can change that pattern via configuring routing. Check this out: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/routing?view=aspnetcore-6.0#route-templates
Made with ❤️ on ABP v8.2.0-preview Updated on 三月 25, 2024, 15:11