Class RedirectResult
Controls the processing of application actions by redirecting to a specified URI.
public class RedirectResult : ActionResult
- Inheritance
-
RedirectResult
- Inherited Members
Constructors
RedirectResult(string)
Initializes a new instance of the RedirectResult class.
public RedirectResult(string url)
Parameters
url
stringThe target URL.
Exceptions
- ArgumentNullException
The
url
parameter is null.
RedirectResult(string, bool)
Initializes a new instance of the RedirectResult class using the specified URL and permanent-redirection flag.
public RedirectResult(string url, bool permanent)
Parameters
url
stringThe URL.
permanent
boolA value that indicates whether the redirection should be permanent.
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.
Url
Gets or sets the target URL.
public string Url { get; }
Property Value
- string
The target URL.
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
ControllerContextThe context within which the result is executed.
Exceptions
- ArgumentNullException
The
context
parameter is null.