Join Jess Chadwick for an in-depth discussion in this video Reuse application features with view components, part of Learn ASP.NET Core MVC: The Basics.
- [Instructor] Earlier in the course,…I demonstrated two concepts which at the time,…probably seemed completely unrelated,…dependency injection and partial views.…However, put them together and they become…a powerful way to reuse both logic and views,…known as view components.…View components provide you with an easy,…and convenient way to both execute logic,…and render the result all with one call…to a single HTML helper.…To find a good example of a scenario…when a view component would be helpful,…we have to look no further than the homepage…of our sample application.…
See the section labeled monthly specials…in the left hand column, that section is currently…just hard-coded HTML in our layout, but if it had…a real implementation, it would involve going…to the database and grabbing the latest monthly specials.…Since this markup is in our layout, every single…action that implemented that layout would have to know…how to get those monthly specials, which would be…terribly hard to maintain, not to mention…a huge violation of separation of concerns.…
- Building blocks of ASP.NET Core applications
- Creating a new project
- Responding to HTTP requests
- Serving static files
- Understanding the MVC pattern
- Handling requests with controllers
- Rendering HTML with Razor
- Rendering data, view markup, and view logic
- Creating HTML forms
- Validating form data
- Reading and writing from a database with Entity Framework
- Improving the user experience
- Exposing data with a web API
- Securing your ASP.NET application
Skill Level Intermediate
1. The Basics
2. The Model-View-Controller (MVC) Pattern
Understand routing4m 24s
3. Render HTML with Views
4. Work with Data
5. Improve User Experience with Ajax and Web APIs
6. Secure Your Application
Next steps1m 42s
- 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.Cancel
Take 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.