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

Makow picture Makow · Sep 8, 2017 · Viewed 9.1k times · Source

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

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

app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Members}/{action=Index}/{id?}");
            });

But now I'm trying new Razor Pages approach, and now Members is folder and Index is Razor Page. How to set this page in folder as starting one?

I can add Index page in root directory and make redirect there, but I was looking for something cleaner.

Answer

Brad Patton picture Brad Patton · Sep 14, 2017

For testing purposes you can change the start page by going to the Properties window for the web project and select the Debug tab. On the 'Launch browser' line enter the starting path

enter image description here