ControllerBase
ControllerBase is the ASP.NET Core MVC base class providing controller behavior and action-result helpers without view-specific functionality.
Pro ASP.NET Core 7, Tenth Edition
ControllerBase is the ASP.NET Core base class that provides controller behavior and helper methods for creating action results.
- How it is used
- Provides request features and action-result helpers for RESTful ASP.NET Core MVC controllers.
- How deep it goes
- Explains discovery, per-request properties, default return behavior, and explicit response helpers through controller actions; defers detailed validation treatment.
- Examples
- Uses product GET and POST actions, a missing-product request, and redirect actions tested with PowerShell commands.
- What you can do after
- Build it from scratch: create a ControllerBase-derived product controller and select explicit success, missing-resource, or redirect responses.
Read how Pro ASP.NET Core 7, Tenth Edition explains ControllerBase →
ASP.NET Core in Action, 3e
The Controller base class is the ASP.NET Core MVC base class that provides controller infrastructure, including access to an IUrlHelper.
- How it is used
- Supports ASP.NET Core web API controllers that expose HTTP actions without returning Razor views.
- How deep it goes
- Explains the base class, helper methods, inheritance choice, routing, serialization, and basic success and error responses.
- Examples
- Demonstrates FruitController, a fruit collection, GET routing, JSON serialization, and NotFound handling.
- What you can do after
- Build a small web API controller that returns serialized data and produces an appropriate error result.
Read how ASP.NET Core in Action, 3e explains ControllerBase →
Also covered in
What to know first
- routingRouting is the process of directing an item, request, or task to a destination or processing path according to relevant rules or characteristics.
Related concepts
- controllerincludes · A controller is a software component that receives input or requests and coordinates other components or operations to produce a response or change application state.
- action resultproduces · An action result is the response or outcome produced by an API or MVC action when handling a request.
- View methodhas part · A View method is an MVC controller method that creates a result for rendering a view, typically selecting the view from the action context.
- ViewBagused by · ViewBag is a dynamic ASP.NET Core MVC property bag for passing unstructured data from a controller or view component to a view.
- IUrlHelperproduces · IUrlHelper is an ASP.NET Core interface for generating URLs from routing information for application actions and endpoints.
Questions about ControllerBase
What is ControllerBase?
ControllerBase is the ASP.NET Core MVC base class providing controller behavior and action-result helpers without view-specific functionality.
Which Manning books explain ControllerBase?
Pro ASP.NET Core 7, Tenth Edition and ASP.NET Core in Action, 3e.
What should I know before learning ControllerBase?
Manning books that teach ControllerBase usually introduce routing first.
What kinds of ControllerBase are there?
Kinds of ControllerBase include controller.
What are the parts of ControllerBase?
ControllerBase includes View method.
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.

