How to change starting page, using Razor Pages in .NET Core 2?

后端 未结 4 1430
我寻月下人不归
我寻月下人不归 2020-12-20 13:37

I wanted to set my starting page to /Members/Index.

When I was using MVC, I configured it as following:

app.UseMvc(routes =>
            {
              


        
4条回答
  •  独厮守ぢ
    2020-12-20 14:09

    I am using this way

    services.AddMvc()
        .AddRazorPagesOptions(options => 
        {
            options.AllowAreas = true;
            options.Conventions.AddAreaPageRoute("Home", "/Index", "");
        });
    

    My folder structure is:

     - Area
       |_ Home
          |_ Pages
             |_ Index.cshtml
       |_ //other areas
    

提交回复
热议问题