In the old days of web applications, things were simple—if you wanted a page, you had to have a physical one. However, things have since evolved and ASP.NET Core is now an MVC framework. What does that mean? Well, in MVC, there are no such thing as physical pages (although this is not exactly true);instead, it uses routing to directrequeststo routehandlers. The most common routehandlers in MVC arecontroller actions. After this chapter, you will learn how to use routing to access your controller actions.
A request is just some relative URL, such as this:
/Search/Mastering%ASP.NET%Core
/Admin/Books
/Book/1
This results in more readable URLs, and is also advantageous for search engines such as Google. The subject of optimizing a site—including its public URLs—for search engines is called Search Engine Optimization (SEO).
When ASP.NET Core receives a request, one of the following two things can happen:
-
...