Join Jess Chadwick for an in-depth discussion in this video Reuse view markup with partial views, part of Learning ASP.NET Core MVC.
- [Instructor] Now that I've shown you how to render…full pages of content using Razor views and layouts,…let's take a look at how you can reuse…sections of Razor markup throughout multiple views…using the partial view technique.…Put simply, partial views allow you to take chunks…of your views and put them in their own separate files…and then stitch them back together again…to create full views.…This helps make your views more manageable,…not to mention it gives you the ability…to reuse the same view in multiple places…throughout your application.…
Check out our blog landing page.…Right now, this page just has a placeholder,…but what I'd like to do is list out…the latest couple of posts here.…Assuming that I want the blog post markup…shown on the landing page to look exactly like…the post markup shown on the individual post pages,…I could implement my landing page…by copying and pasting the Razor markup…from this post view that we just created…and that'll work just fine.…In fact, that's a perfectly legitimate way of doing it,…
Author
Released
12/6/2016- 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
- Routing
- 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
Duration
Views
Related Courses
-
C#: Design Patterns
with Reynald Adolphe1h 22m Intermediate -
Tooling with NPM Scripts
with Ray Villalobos1h 21m Intermediate
-
Introduction
-
Welcome1m 16s
-
What you should know2m 6s
-
Challenges1m 11s
-
-
1. The Basics
-
Create a new project5m 14s
-
Respond to HTTP requests5m 32s
-
Serve static files3m 9s
-
Use custom configuration4m 42s
-
2. The Model-View-Controller (MVC) Pattern
-
Understand routing4m 24s
-
3. Render HTML with Views
-
Render HTML with Razor3m 51s
-
Challenge1m 29s
-
Solution1m 48s
-
-
4. Work with Data
-
Validate form post data5m 55s
-
Challenge44s
-
Solution1m 45s
-
5. Improve User Experience with Ajax and Web APIs
-
Expose web API endpoints4m 7s
-
Challenge31s
-
Solution2m 12s
-
6. Secure Your Application
-
Conclusion
-
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.
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: Reuse view markup with partial views