The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ViewResult Class

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

Namespace:  System.Web.Mvc
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)

public class ViewResult : ViewResultBase

The ViewResult type exposes the following members.

Public methodViewResultInitializes a new instance of the ViewResult class.

Public propertyMasterNameGets the name of the master view (such as a master page or template) to use when the view is rendered.
Public propertyModelGets the view data model. (Inherited from ViewResultBase.)
Public propertyTempDataGets or sets the TempDataDictionary object for this result. (Inherited from ViewResultBase.)
Public propertyViewGets or sets the IView object that is rendered to the response. (Inherited from ViewResultBase.)
Public propertyViewBagGets the view bag. (Inherited from ViewResultBase.)
Public propertyViewDataGets or sets the view data ViewDataDictionary object for this result. (Inherited from ViewResultBase.)
Public propertyViewEngineCollectionGets or sets the collection of view engines that are associated with this result. (Inherited from ViewResultBase.)
Public propertyViewNameGets or sets the name of the view to render. (Inherited from ViewResultBase.)

Public methodEquals (Inherited from Object.)
Public methodExecuteResultWhen called by the action invoker, renders the view to the response. (Inherited from ViewResultBase.)
Protected methodFinalize (Inherited from Object.)
Protected methodFindViewSearches the registered view engines and returns the object that is used to render the view. (Overrides ViewResultBase.FindView(ControllerContext).)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)

An action result represents a command that ASP.NET performs on behalf of an action method. The ViewResult class implements the abstract ViewResultBase class and is used to render a view. This class contains methods for finding the view to render and for executing the result. This class also contains properties that identify the view to render, the name of the view, the name of the master view, view data, temporary data, and a collection for view engines for the application.

If you want an action method to result in a rendered view, the action method should return a call to the controller's View helper method. The View helper method passes a ViewResult object to the ASP.NET MVC framework, which calls the object's ExecuteResult method.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
© 2015 Microsoft