Reputation: 5333
Suppose I have the following routing
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } );
Now, when you generate an url using Url.Action("Index","MyController") you will get as expected : /MyController
But in one exceptional case, I would like to get the full url /MyController/Index (without changing the routing)... does anyone know if this is possible?
Upvotes: 0
Views: 476
Reputation: 101140
It is possible. But you need to modify the routing.
Route
/index
for the pages that needs it.Upvotes: 2
Reputation: 1038720
I am afraid this is not possible. And it shouldn't matter as both urls will resolve to the same controller action.
Upvotes: 1