C# Mastery Hub
Home
Challenges
Discussion
Lessons
Core Topics
C# Fundamentals
Console Applications
Classes & OOP
Windows Forms
ASP.NET Core
SQL Server
VS & SQL Connection
RDLC Reports
.NET MAUI
Getting Started
Getting Started
Website Development
SEO Guide
Security
Project Workflow
Extra Topics
Cloud & Deployment
AWS Cloud
Deployment
About
Contact
Test Your Knowledge
Razor Pages - Lesson 2: PageModel and Routing Quiz
Answer all questions to test your understanding
1
What is the PageModel in Razor Pages?
The HTML template
The code-behind file for a Razor Page
The database model
The CSS stylesheet
2
How do you define a custom route in Razor Pages?
Using the @page directive with a route template
Using the [Route] attribute on the PageModel
Using the MapRoute method
Using the route.config file
3
What is the default routing convention in Razor Pages?
/Pages/PageName
/PageName
The folder structure determines the URL path
Custom routes must always be defined
4
Which route constraint ensures a parameter is a valid integer?
{id:int}
{id:integer}
{id:num}
{id:number}
5
How do you access a route parameter in the PageModel?
As a property decorated with [BindProperty]
As a parameter in the OnGet method
Using the Request object
All of the above
Submit Quiz