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 →
What to know first
- controllerA controller is a software component that receives input or requests and coordinates other components or operations to produce a response or change application state.
- web API action methodA web API action method is a controller method associated with a matched HTTP request that processes it and produces a response.
Related concepts
- viewproduced by · A view is a representation or access interface that presents selected, transformed, or derived information from underlying data or state.
- IActionResultkind of · IActionResult is an ASP.NET Core MVC interface representing the result of processing an HTTP request.
- 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.
- Razor syntaxuses · Razor syntax is a templating syntax that combines markup with embedded .NET code and directives to generate web content.
- viewuses · A view is a presentation component or template that renders application data into a user-interface element or client response.
- 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.
Questions about ViewResult
What is ViewResult?
ViewResult is an MVC action-result type that represents rendering a view with an optional name and model.
Which Manning books explain ViewResult?
ASP.NET Core in Action, 3e and Pro ASP.NET Core 7, Tenth Edition.
What should I know before learning ViewResult?
Manning books that teach ViewResult usually introduce controller and web API action method first.
What is ViewResult a kind of?
ViewResult is a kind of IActionResult. IActionResult is an ASP.NET Core MVC interface representing 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.

