Controller::View Method

Creates a ViewResult object that renders a view to the response.

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

protected public:
ViewResult^ View()

Return Value

Type: System.Web.Mvc::ViewResult
The View() result that renders a view to the response.

This method overload of the View() class returns a ViewResult object that has an empty ViewName property. If you are writing unit tests for controller actions, take into account the empty ViewName property for unit tests that do not take a string view name.

At run time, if the ViewName property is empty, the current action name is used in place of the ViewName property.