ViewResult Class¶
Represents an Microsoft.AspNetCore.Mvc.ActionResult
that renders a view to the response.
- Namespace
Microsoft.AspNetCore.Mvc
- Assemblies
- Microsoft.AspNetCore.Mvc.ViewFeatures
Syntax¶
public class ViewResult : ActionResult, IActionResult
-
class
Microsoft.AspNetCore.Mvc.
ViewResult
Properties¶
-
Microsoft.AspNetCore.Mvc.ViewResult.
ContentType
¶ Gets or sets the Content-Type header for the response.
Return type: System.String public string ContentType { get; set; }
-
Microsoft.AspNetCore.Mvc.ViewResult.
Model
¶ Gets the view data model.
Return type: System.Object public object Model { get; }
-
Microsoft.AspNetCore.Mvc.ViewResult.
StatusCode
¶ Gets or sets the HTTP status code.
Return type: System.Nullable<System.Int32> public int ? StatusCode { get; set; }
-
Microsoft.AspNetCore.Mvc.ViewResult.
TempData
¶ Gets or sets the
Microsoft.AspNetCore.Mvc.ViewFeatures.ITempDataDictionary
for this result.Return type: Microsoft.AspNetCore.Mvc.ViewFeatures.ITempDataDictionary public ITempDataDictionary TempData { get; set; }
-
Microsoft.AspNetCore.Mvc.ViewResult.
ViewData
¶ Gets or sets the
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary
for this result.Return type: Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary public ViewDataDictionary ViewData { get; set; }
-
Microsoft.AspNetCore.Mvc.ViewResult.
ViewEngine
¶ Gets or sets the
Microsoft.AspNetCore.Mvc.ViewEngines.IViewEngine
used to locate views.Return type: Microsoft.AspNetCore.Mvc.ViewEngines.IViewEngine public IViewEngine ViewEngine { get; set; }
-
Microsoft.AspNetCore.Mvc.ViewResult.
ViewName
¶ Gets or sets the name of the view to render.
Return type: System.String public string ViewName { get; set; }
-