Year End Sale: Get Upto 40% OFF on Live Training! Offer Ending in
D
H
M
S
Get Now

Creating View Component and Partial View

Level : Beginner
Mentor: Shailendra Chauhan
Type : GuidedLab
Points : 10
Duration : 00:45:00

Lab Details

Description

In this lab, you will be learning how to create and manage a web page’s static and dynamic sections. By the end of the lab, you'll have the skills to create an application with Partial views and to use ViewComponent to display the dynamic data.

Lab Objective

Upon completion of this lab, you will be able to:

  • Create how to create the Partial views in your ASP.NET Core application.
  • Create a View component and invoke it.
  • Connect to the backend API to fetch the details.

Prerequisites

You should have a basic understanding of Partial Views and ViewComponents in ASP.NET Core

Lab Requirements

  • Create a Post page to display the post
    • Access the post comments from the comment’s backend API at https://jsonplaceholder.typicode.com/
  • And display them using a ViewComponent
  • Display a post and access comments based on the Id of the post.
  • Show the comments counts.
  • Create a reusable Menu for the website.
  • The schema for the models is as:

PostViewModel

{
       Id = 1,
       Title = "What is ASP.NET Core",
       Author = "Shailendra Chauhan",
       Body = "ASP.NET Core is an open-source framework for building UI and API..."
}

CommentViewModel

{
  PostId= 1,
  Id= 1,
  Name= "id labore ex et quam laborum",
  Email= "Eliseo@gardner.biz",
  Body= "laudantium enim quasi est quidem magnam voluptate ipsam"
}

Self-paced Membership
  • 24+ Video Courses
  • 825+ Hands-On Labs
  • 400+ Quick Notes
  • 125+ Skill Tests
  • 10+ Interview Q&A Courses
  • 10+ Real-world Projects
  • Career Coaching Sessions
  • Email Support
Upto 60% OFF
Know More
Still have some questions? Let's discuss.
CONTACT US
Accept cookies & close this