Controller Action Result (2), in ASP.NET (Core) MVC

This series of articles is to discuss the Action Results for ASP.NET (Core) MVC and Web API.

This article discusses Controller Action Results for ASP.NET MVC.

A - Introduction

This article is a following up for the previous article, Controller Action Result (1), in ASP.NET MVC to cover the situation of ASP.NET Core MVC. This article actually has the same conclusion as previous one, with emphasis to Core situation. This article will include the following content:

  • A - Introduction
  • B - Controller Action Workflow
  • C - Action Results (Core)
    • ActionResult Classes (Core)
    • ActionResult Categories (Core)
    • All Types of Action Methods in ASP.NET Core MVC

B - Controller Action Workflow

MVC workflow:

  • MVC controllers are responsible for responding to requests made against an ASP.NET MVC website. Each browser request is mapped to a particular controller.
  • A controller exposes controller actions. An action is a method on a controller that gets called when you enter a particular URL in your browser address bar.
  • An action result is what a controller action returns in response to a browser request.

C - Action Results (Core)

MVC framework includes various Result classes, which can be returned from an action method. The result classes represent different types of responses, such as HTML, file, string, JSON, javascript, etc. The following list all the result classes available in ASP.NET MVC, ASP.NET Core MVC, ASP.NET Web API, and ASP.NET Core Web API.

  • Action Result Categories

Tthere are three categories of data types of ActionResult.

  1. Content Returning Results
  2. Redirection Results
  3. Status Results

such as

  • All Types of Action Methods in ASP.NET Core MVC

Plus subDerived Classes:

References


Similar Articles