I have the following route:
routes.MapRoute(
"SetPassword",
"Account/SetPassword/{token}",
new { controller = "Account", action = "SetPassword" }
);
and I want the token to be mandatory. But the problem is that if the token is missing, route falls back to the default one:
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
What I want is to return 404 Not Found if someone enters an address like
http://mysite.com/Account/SetPassword
How do I specify that the token is mandatory parameter and the routing must stop at this route if controller and action names match the specification?