Table of Contents

Class RedirectToRouteResult

Namespace
System.Web.Mvc
Assembly
System.Web.Mvc.dll

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

routeName string

The name of the route.

routeValues RouteValueDictionary

The 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

routeName string

The name of the route.

routeValues RouteValueDictionary

The route values.

permanent bool

A 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

routeValues RouteValueDictionary

The 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

context ControllerContext

The context within which the result is executed.

Exceptions

ArgumentNullException

The context parameter is null.