Table of Contents

Class ViewResultBase

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

Represents a base class that is used to provide the model to the view and then render the view to the response.

public abstract class ViewResultBase : ActionResult
Inheritance
ViewResultBase
Derived
Inherited Members

Constructors

ViewResultBase()

Initializes a new instance of the ViewResultBase class.

protected ViewResultBase()

Properties

Model

Gets the view data model.

public object Model { get; }

Property Value

object

The view data model.

TempData

Gets or sets the TempDataDictionary object for this result.

public TempDataDictionary TempData { get; set; }

Property Value

TempDataDictionary

The temporary data.

View

Gets or sets the IView object that is rendered to the response.

public IView View { get; set; }

Property Value

IView

The view.

ViewBag

Gets the view bag.

public dynamic ViewBag { get; }

Property Value

dynamic

The view bag.

ViewData

Gets or sets the view data ViewDataDictionary object for this result.

public ViewDataDictionary ViewData { get; set; }

Property Value

ViewDataDictionary

The view data.

ViewEngineCollection

Gets or sets the collection of view engines that are associated with this result.

public ViewEngineCollection ViewEngineCollection { get; set; }

Property Value

ViewEngineCollection

The collection of view engines.

ViewName

Gets or sets the name of the view to render.

public string ViewName { get; set; }

Property Value

string

The name of the view.

Methods

ExecuteResult(ControllerContext)

When called by the action invoker, renders the view to the response.

public override void ExecuteResult(ControllerContext context)

Parameters

context ControllerContext

The context that the result is executed in.

Exceptions

ArgumentNullException

The context parameter is null.

FindView(ControllerContext)

Returns the ViewEngineResult object that is used to render the view.

protected abstract ViewEngineResult FindView(ControllerContext context)

Parameters

context ControllerContext

The context.

Returns

ViewEngineResult

The view engine.