RedirectResult Class

Definition

An ActionResult that returns a Found (302), Moved Permanently (301), Temporary Redirect (307), or Permanent Redirect (308) response with a Location header to the supplied URL.

public ref class RedirectResult : Microsoft::AspNetCore::Mvc::ActionResult, Microsoft::AspNetCore::Mvc::IActionResult, Microsoft::AspNetCore::Mvc::ViewFeatures::IKeepTempDataResult
public class RedirectResult : Microsoft.AspNetCore.Mvc.ActionResult, Microsoft.AspNetCore.Mvc.IActionResult, Microsoft.AspNetCore.Mvc.ViewFeatures.IKeepTempDataResult
type RedirectResult = class
    inherit ActionResult
    interface IKeepTempDataResult
    interface IActionResult
type RedirectResult = class
    inherit ActionResult
    interface IActionResult
    interface IKeepTempDataResult
Public Class RedirectResult
Inherits ActionResult
Implements IActionResult, IKeepTempDataResult
Inheritance
RedirectResult
Implements

Constructors

RedirectResult(String)

Initializes a new instance of the RedirectResult class with the values provided.

RedirectResult(String, Boolean)

Initializes a new instance of the RedirectResult class with the values provided.

RedirectResult(String, Boolean, Boolean)

Initializes a new instance of the RedirectResult class with the values provided.

Properties

Permanent

Gets or sets the value that specifies that the redirect should be permanent if true or temporary if false.

PreserveMethod

Gets or sets an indication that the redirect preserves the initial request method.

Url

Gets or sets the URL to redirect to.

UrlHelper

Gets or sets the IUrlHelper for this result.

Methods

ExecuteResult(ActionContext)
ExecuteResult(ActionContext)

Executes the result operation of the action method synchronously. This method is called by MVC to process the result of an action method.

(Inherited from ActionResult)
ExecuteResultAsync(ActionContext)
ExecuteResultAsync(ActionContext)

Executes the result operation of the action method asynchronously. This method is called by MVC to process the result of an action method. The default implementation of this method calls the ExecuteResult(ActionContext) method and returns a completed task.

(Inherited from ActionResult)

Applies to