Table of Contents

Class ViewResult

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

Represents a class that is used to render a view by using an IView instance that is returned by an IViewEngine object.

public class ViewResult : ViewResultBase
Inheritance
ViewResult
Inherited Members

Constructors

ViewResult()

Initializes a new instance of the ViewResult class.

public ViewResult()

Properties

MasterName

Gets the name of the master view (such as a master page or template) to use when the view is rendered.

public string MasterName { get; set; }

Property Value

string

The name of the master view.

Methods

FindView(ControllerContext)

Searches the registered view engines and returns the object that is used to render the view.

protected override ViewEngineResult FindView(ControllerContext context)

Parameters

context ControllerContext

The controller context.

Returns

ViewEngineResult

The object that is used to render the view.

Exceptions

InvalidOperationException

An error occurred while the method was searching for the view.