Creating A Webpage with Razor View

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

Lab Details


The purpose of this lab is to guide you through the creation of a user management system using ASP.NET Core and Razor syntax. By the end of this lab, you will have developed a comprehensive understanding of how to utilize Razor syntax for creating dynamic web pages.

Lab Objective

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

  • Build a web page that uses Razor syntax for user creation, ensuring form data is submitted properly.
  • Develop a dynamic listing page to display users, employ conditional logic for empty datasets,
  • Apply logic for alternating row colors for enhanced readability.


You should have a basic understanding of Razor View Engine in ASP.NET Core.

Lab Requirements

  • Create A web page using Razor syntax to facilitate the creation of a new user. This form should capture essential user information such as UserId, Name, and Email.
  • Ensure that the form data is submitted to a designated action method responsible for user creation.
  • Develop a dynamic listing page to display all users. Leverage Razor syntax to iterate over the user collection and display each user's details in a tabular format.
  • Incorporate conditional logic to display a message when no users are found.
  • Implement alternating row colours as lightblue for enhanced readability.
  • The schema for the models is as:
   UserId = 1,
   Name = "Mohan",
   Email = ""
Self-paced Membership
  • 22+ Video Courses
  • 800+ Hands-On Labs
  • 400+ Quick Notes
  • 55+ Skill Tests
  • 45+ 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.
Accept cookies & close this