ViewResult Class

Summary

Represents an [Microsoft.AspNet.Mvc.ActionResult]() that renders a view to the response.

Syntax

public class ViewResult : ActionResult, IActionResult

GitHub

View on GitHub

class Microsoft.AspNet.Mvc.ViewResult

Properties

ContentType()

Gets or sets the @!:MediaTypeHeaderValue- representing the Content-Type header of the response.

Return type:MediaTypeHeaderValue
public MediaTypeHeaderValue ContentType { get; set; }
StatusCode()

Gets or sets the HTTP status code.

Return type:System.Nullable{System.Int32}
public int ? StatusCode { get; set; }
TempData()

Gets or sets the [Microsoft.AspNet.Mvc.ITempDataDictionary]() for this result.

Return type:Microsoft.AspNet.Mvc.ITempDataDictionary
public ITempDataDictionary TempData { get; set; }
ViewData()

Gets or sets the [Microsoft.AspNet.Mvc.ViewDataDictionary](Microsoft.AspNet.Mvc.ViewDataDictionary.yml) for this result.

Return type:Microsoft.AspNet.Mvc.ViewDataDictionary
public ViewDataDictionary ViewData { get; set; }
ViewEngine()

Gets or sets the [Microsoft.AspNet.Mvc.Rendering.IViewEngine](Microsoft.AspNet.Mvc.Rendering.IViewEngine.yml) used to locate views.

Return type:Microsoft.AspNet.Mvc.Rendering.IViewEngine
public IViewEngine ViewEngine { get; set; }
ViewName()

Gets or sets the name of the view to render.

Return type:System.String
public string ViewName { get; set; }

Methods

ExecuteResultAsync(Microsoft.AspNet.Mvc.ActionContext)
Arguments:
Return type:

System.Threading.Tasks.Task

public override Task ExecuteResultAsync(ActionContext context)