I have created the following RedirectToRouteResult:
new RedirectToRouteResult(new RouteValueDictionary{
{ "controller", "Login" },
{ "action", "Failed" },
{ "ReturnUrl", filterContext.HttpContext.Request.Url.PathAndQuery }
});
This fails to find the specified route (which I know works if typed in browser by hand). However if I add in the name of the route like below it works fine, but I don't get why.
new RedirectToRouteResult("Login_failed",
new RouteValueDictionary{
{ "controller", "Login" },
{ "action", "Failed" },
{ "ReturnUrl", filterContext.HttpContext.Request.Url.PathAndQuery }
});
I didn't think I would have to specify the name if all the correct values were there?