4 Creating a website with Razor Pages

 

This chapter covers

  • Introducing Razor Pages and the Model-View-Controller (MVC) design pattern
  • Using Razor Pages in ASP.NET Core
  • Choosing between Razor Pages and MVC controllers
  • Controlling application flow using action results

In chapter 3 you learned about the middleware pipeline, which defines how an ASP.NET Core application responds to a request. Each piece of middleware can modify or handle an incoming request before passing the request to the next middleware in the pipeline.

In ASP.NET Core web applications, your middleware pipeline will normally include the EndpointMiddleware. This is typically where you write the bulk of your application logic, calling various other classes in your app. It also serves as the main entry point for users to interact with your app. It typically takes one of three forms:

4.1 An introduction to Razor Pages

4.1.1 Exploring a typical Razor Page

4.1.2 The MVC design pattern

4.1.3 Applying the MVC design pattern to Razor Pages

4.1.4 Adding Razor Pages to your application

4.2 Razor Pages vs. MVC in ASP.NET Core

4.2.1 MVC controllers in ASP.NET Core

4.2.2 The benefits of Razor Pages

4.2.3 When to choose MVC controllers over Razor Pages

4.3 Razor Pages and page handlers

4.3.1 Accepting parameters to page handlers

4.3.2 Returning responses with ActionResults

Summary