Lyra
Learn
AI Learning Platform
π Midnight
π Comfort
π₯ Ember
π Paper
β Contrast
Exams
Sign in to track progress
β Back to the lesson
Module 2 Β· Quiz
Views, ViewModels, and Action Results
1. What is the primary purpose of a ViewModel in the MVC pattern?
To store all application data in one class
To define the exact data required by a specific view
To enable database operations directly through the view
To manage user authentication and authorization
2. Which ActionResult should be used to create a redirect after a successful POST request?
View()
PartialView()
RedirectToAction()
Json()
3. What is a potential downside of using ViewBag for passing data to a view?
It is strongly typed and checked at compile time
It can lead to compile-time errors if misused
It allows for a flexible data contract not tied to model classes
It lacks compile-time checking leading to runtime issues
4. Which of the following ActionResults should be used to return a JSON response for AJAX calls?
View()
PartialView()
Json()
File()
Submit answers
Continue: Filters, Areas, and Configuration β
Review this lesson
Retake quiz