Creates a ViewResult object that renders a view to the response.
Assembly: System.Web.Mvc (in System.Web.Mvc.dll)
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.
This method returns the view that matches the action result name from the Views subfolder that in turn matches the controller name. For example, if you are using the default view engine, the action result TestJson in a controller named PRGController returns the following view:
The following example shows how to return a view from an action method. Both action methods return the TestJson.aspx page from the Views subfolder that matches the controller name. The TestJson method defaults to returning the TestJson.aspx page. The TestJsonContent method explicitly returns the TestJson.aspx page.