ViewResult
ViewResult is an MVC action-result type that represents rendering a view with an optional name and model.
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.
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
- viewproduced by · A view is a derived representation of data or application state presented for reading or rendering.
- web API action methodproduced by · A web API action method is a controller method associated with a matched HTTP request that processes it and produces a response.
- Razor compileruses · The Razor compiler transforms Razor files containing markup and code into generated classes or output for execution by an ASP.NET Core application.
- View methodproduced by · A View method is an MVC controller method that creates a result for rendering a view, typically selecting the view from the action context.
- viewuses · A view is a presentation component or template that renders application data into a user-interface element or client response.
- IActionResultkind of · IActionResult is an ASP.NET Core MVC interface implemented by objects that represent the result of processing an HTTP request.
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.

