liveBook · Manning

ViewResult

ViewResult is an MVC action-result type that represents rendering a view with an optional name and model.

How 2 Manning books explain it

ASP.NET Core in Action, 3e

ViewResult is an ASP.NET Core MVC action result that renders a Razor view using an optional view name and model.

How it is used
Instructs MVC controllers to render a Razor view after an action executes.
How deep it goes
Explains optional names, models, runtime view lookup, and Razor rendering, but does not detail lookup heuristics.
Examples
Uses HomeController, ToDoController, Index(), named ViewToDo, and ErrorViewModel examples.
What you can do after
Apply it via the View() helper to render conventional or named Razor views with optional models.

Read how ASP.NET Core in Action, 3e explains ViewResult →

Pro ASP.NET Core 7, Tenth Edition

ViewResult is an MVC action-result type that represents rendering a named view in response to an action.

How it is used
Directs an MVC action to render a named view as an HTML response, optionally using action-supplied data.
How deep it goes
Shows creation, view lookup, model passing, and request flow; defers detailed Razor syntax.
Examples
Uses a greeting view and an RSVP thank-you view driven by a submitted response.
What you can do after
Apply it via ASP.NET Core MVC to return named views with models and check view-location errors.

Read how Pro ASP.NET Core 7, Tenth Edition explains ViewResult →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.