Home > Net >  Tutorial ASP.NET Core app not seen by localhost
Tutorial ASP.NET Core app not seen by localhost

Time:12-30

Using MS Visual Studio 2022 on Windows 10 pro to build an ASP.NET Core MVC for the first time. When this tutorial (enter image description here

If you need to use MvcMovie as the routing address in the Url, you can do this:

Controller:

 [ApiController]
    public class TestController : Controller
    {

        [HttpGet]
        [Route("MvcMovie")]
        public IActionResult MvcMovie()
        {
            return View();
        }
    }

View demo:

<h1>This is MvcMovie Controller!</h1>

Test url:https://localhost:7040/MvcMovie

Result:

enter image description here

I think you need to know the routing rules in mvc, you can read this document:

Routing to controller actions in ASP.NET Core

  • Related