Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Default route not working in Asp.Net Core

$
0
0

I have the following Controller & Action that I want to be the first page that is loaded when the user enters my webapp:

    [Route("auth")]
    public class AuthController : Controller
    {
        [Route("signin")]
        public IActionResult SignIn(bool signInError)
        {
        }
    }

I try to do this in my app.UseMvc options like so:

    app.UseMvc(routes =>
    {
        routes.MapRoute(
            name: "default",
            template: "{controller=auth}/{action=signin}/");
    });

However, when I start my webapp it simply navigates to http://localhost:52608/.

If I type in http://localhost:52608/auth/signin?ReturnUrl=%2F the webpage loads correctly on the page I want to be on when the user starts the webapp.

My question is, how do I set this up so it can navigate to this page as soon as the user opens the webapp?


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>