- Modern Web Development with ASP.NET Core 3
- Ricardo Peres
- 236字
- 2021-06-18 18:35:57
Routing
This chapter talks about routing, that is, the process by which ASP.NET Core translates a user request into an MVC controller and action. This can be a complex process because subtle changes in a request can lead to different endpoints (controller/action pairs) being called. Several aspects need to be taken into account: the protocol (HTTP or HTTPS), whether the user issuing the request is authenticated or not, the HTTP verbs, the path of the request, the query string, and the actual types of the path and query string parameter values.
Routing also defines what happens when a route is not matched, that is, the catch-all route, and it can be used for complex situations where we need to define custom route constraints.
ASP.NET Core offers different ways by which we can configure routing, which can be divided into convention-based and explicit configuration.
By the end of this chapter, you will be able to define routing tables and apply routing configuration in all of the different ways made available by ASP.NET Core for MVC applications.
The objectives of this chapter are listed here:
- Understanding endpoint routing
- Configuring routing
- Understanding routing tables
- Using route templates
- Matching route parameters
- Using dynamic routing
- Learning route selection through attributes
- Forcing host selection from attributes
- Setting route defaults
- Routing to inline handlers
- Applying route constraints
- Using route data tokens
- Routing to areas
- Using attributes for routing
- Using routes for error handling
- Java逍遙游記
- 流量的秘密:Google Analytics網站分析與優化技巧(第2版)
- C#程序設計教程
- The HTML and CSS Workshop
- Django 3.0應用開發詳解
- PrimeFaces Blueprints
- HTML5+CSS3+jQuery Mobile APP與移動網站設計從入門到精通
- PHP與MySQL權威指南
- 愛上C語言:C KISS
- C#面向對象程序設計(第2版)
- Getting Started with React VR
- Instant GLEW
- 軟硬件綜合系統軟件需求建模及可靠性綜合試驗、分析、評價技術
- AI輔助編程Python實戰:基于GitHub Copilot和ChatGPT
- HTML5程序開發范例寶典