0
good night..
I have the following Controller: Homcontroller
with Action: Login
By clicking the enter button my URL is as follows:
http://localhost:58379/home/login
I would like the URL not to be presented that way, and yes:
http://localhost:58379/Welcome
I tried to reconfigure the route, but all my attempts failed:
routes.MapMvcAttributeRoutes();
routes.MapRoute(
"T",
"bemvindo",
new { controller = "Home", action = "Login" }
);
where is my error in this configuration?
i need to set the Rote attribute in my Controller/Action?
thank you!
you can use
Route
to pass the name you want to your action, but to remove your controller name look at this answer here, and see if it fits.– Vinicius
Have you tried to put [Route("Welcome")] just above your Login action in Home controller?
– Fabri Damazio
yes. had already tried to put [Route("Welcome")]
– ipakng