Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

RedirectToRouteResult doesn't use RouteName property when calculating destination URL #2545

Closed
@michaelnero

Description

@michaelnero

The Controller.RedirectToRoute() method creates a RedirectToRouteResult instance and passes in the routeName and routeValues parameters to it, which are assigned to the RedirectToRouteResult.RouteName and RedirectToRouteResult.RouteValues properties, respectively.

However, on line 48 in the RedirectToRouteResult.ExecuteResult() method, the RouteName property is never used to calculate the destination URL; it is essentially ignored.

I would have expected that Controller.RedirectToRoute() method to consider my provided routeName when calculating the destination URL.

The workaround for now, is pretty simple: just calculate my own destination URL using the controller's UrlHelper, but since Controller.RedirectToRoute() didn't behave as I had expected it to, I'm filing an issue for it.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions