In this video, learn about ASP.NET MVC convention-based routing, and how to configure custom routes that map to controllers and actions.
- [Instructor] Let's explore convention based routing…and learn how to configure it in our MVC application.…In the Roux Academy project, under the app start folder…open the route config file.…In the register routes method,…notice how there's a default route already mapped.…This will typically match most of our routes,…but if we have specialized routes to handle…we could add them to the route table using map route.…
This approach is called convention based routing.…One important point to remember is that…the order in which we add routes to the route table matters,…that's because the routing engine selects…the first route that matches.…More specialized URLs should be added before general ones…and the default route would be last.…Let's create a custom route for one of our home views.…If you open up the home controller…there's a programs action that displays…the academic programs at Roux Academy.…
Based on the default route we have defined,…we would navigate to home forward slash programs to see it.…But what if we want users to simply type in…
Author
Released
5/1/2018- Fundamentals of the request life cycle
- Designing and implementing HTTP modules and handlers
- Choosing between handlers and modules
- Understanding route handlers
- Configuring convention-based routing
- ASP.NET MVC attribute routing
- Creating a custom controller factory
- Defining a custom dependency resolver
- Creating a custom view engine
Skill Level Intermediate
Duration
Views
Related Courses
-
Introduction
-
Welcome1m 4s
-
What you should know1m 31s
-
-
1. The Application and Request Life Cycle
-
2. Design and Implement HTTP Modules and Handlers
-
HTTP module overview3m 52s
-
-
3. The ASP.NET MVC Routing System
-
Introduction to routing2m 10s
-
URL routing module overview3m 43s
-
Understand route handlers1m 53s
-
Explore attribute routing4m 10s
-
-
4. Controllers and the Request Life Cycle
-
Controller basics1m 38s
-
-
5. The Action Method Execution Process
-
6. Result Execution and the View Engine
-
Explore action result types3m 24s
-
Conclusion
-
Next steps1m 11s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Configure convention-based routing