'Asp Net Mvc Routing without action on multiple Controllers
My Asp Net MVC Application contains 4 Controllers: Home | Training | Diet | Configuration
routes.MapRoute(
name: "Default",
url: "{action}/{id}",
defaults: new { controller = "Home", action = "Authorize", id = UrlParameter.Optional }
);
When I want to do a `RedirectToAction("Configurator","Configuration") it tells me the Route isnt found. Picture
I tried adding different types of Routes but I never achieved the following scenario:
I just want the URL to doesnt contain the Controllername:
So instead of:
Before: https://localhost/Home/Login
After: https://localhost/Login
but also
Before: https://localhost/Diet/DailyData
After: https://localhost/DailyData
I have a lot of Methods in every Controller so I don't wanna set up for a Route for every Method. Is this possible and how?
Thank you already so much in advance!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
