Class RedirectToRouteResult
Represents a result that performs a redirection by using the specified route values dictionary.
public class RedirectToRouteResult : ActionResult
- Inheritance
-
RedirectToRouteResult
- Inherited Members
Constructors
RedirectToRouteResult(string, RouteValueDictionary)
Initializes a new instance of the RedirectToRouteResult class by using the specified route name and route values.
public RedirectToRouteResult(string routeName, RouteValueDictionary routeValues)
Parameters
routeNamestringThe name of the route.
routeValuesRouteValueDictionaryThe route values.
RedirectToRouteResult(string, RouteValueDictionary, bool)
Initializes a new instance of the RedirectToRouteResult class by using the specified route name, route values, and permanent-redirection flag.
public RedirectToRouteResult(string routeName, RouteValueDictionary routeValues, bool permanent)
Parameters
routeNamestringThe name of the route.
routeValuesRouteValueDictionaryThe route values.
permanentboolA value that indicates whether the redirection should be permanent.
RedirectToRouteResult(RouteValueDictionary)
Initializes a new instance of the RedirectToRouteResult class by using the specified route values.
public RedirectToRouteResult(RouteValueDictionary routeValues)
Parameters
routeValuesRouteValueDictionaryThe route values.
Properties
Permanent
Gets a value that indicates whether the redirection should be permanent.
public bool Permanent { get; }
Property Value
- bool
true if the redirection should be permanent; otherwise, false.
RouteName
Gets or sets the name of the route.
public string RouteName { get; }
Property Value
- string
The name of the route.
RouteValues
Gets or sets the route values.
public RouteValueDictionary RouteValues { get; }
Property Value
- RouteValueDictionary
The route values.
Methods
ExecuteResult(ControllerContext)
Enables processing of the result of an action method by a custom type that inherits from the ActionResult class.
public override void ExecuteResult(ControllerContext context)
Parameters
contextControllerContextThe context within which the result is executed.
Exceptions
- ArgumentNullException
The
contextparameter is null.