Lyra
Learn
AI Learning Platform
π Midnight
π Comfort
π₯ Ember
π Paper
β Contrast
Exams
Sign in to track progress
β Back to the lesson
Module 3 Β· Quiz
Razor Views and Layouts
1. What is the primary purpose of Razor in ASP.NET Core?
To create desktop applications
To handle server-side logic only
To combine C# and HTML in a templating language
To manage database connections
2. What does the `@RenderSection` method do in a Razor layout?
Executes a block of C# code
Inserts content defined in a section from a view
Defines global variables for all views
Renders a partial view
3. Why should you always pass an explicit model to a partial view instead of allowing it to read from the parent model?
It reduces the size of the final HTML output
Partial views should always be independent for reusability
It prevents syntax errors
It makes debugging easier
4. What does Razor do to protect against XSS vulnerabilities when rendering HTML output?
Automatically sanitizes all user input
HTML-encodes everything it outputs
Disables script tags
Validates all models before rendering
Submit answers
Continue: jQuery Patterns That Scale β
Review this lesson
Retake quiz