
Q1
Q1 What does "MVC" in ASP.NET MVC stand for?
Model, View, Controller
Module, View, Component
Model, View, Connection
Middleware, Version, Control
Q2
Q2 What is the main purpose of the Model in MVC?
Handle data
Define routes
Manage user interface
Control the view
Q3
Q3 Which component in MVC is responsible for handling user input?
Model
View
Controller
Database
Q4
Q4 What does the View in MVC primarily represent?
User Interface
Application Logic
Database Structure
Error Handling
Q5
Q5 What advantage does MVC offer over traditional web development models?
Separation of concerns
Single point of control
Better SQL integration
Reduced coding
Q6
Q6 ASP.NET MVC is part of which larger framework?
.NET Framework
Node.js
Spring
Ruby on Rails
Q7
Q7 What kind of pattern is MVC considered to be?
Architectural
Design
Behavioral
Structural
Q8
Q8 Which method in the controller returns a view in ASP.NET MVC?
ViewResult()
ReturnView()
RedirectToView()
View()
Q9
Q9 You receive a "404 Not Found" error while accessing a route. What could be the reason?
Missing route in RouteConfig
Database error
Invalid Razor syntax
Missing controller method
Q10
Q10 What is the main purpose of the MVC architecture?
Separate concerns
Optimize SQL queries
Simplify deployment
Ensure security
Q11
Q11 In ASP.NET MVC, what does the Controller primarily do?
Handles business logic
Renders UI
Manages routing
Defines data schema
Q12
Q12 Which part of MVC is responsible for rendering the user interface?
Model
View
Controller
Route
Q13
Q13 What is the lifecycle sequence of an MVC request?
Routing → Controller → Model → View
Routing → View → Controller → Model
Controller → Routing → Model → View
Model → View → Routing → Controller
Q14
Q14 Which file in ASP.NET MVC defines the routing configuration?
RouteConfig.cs
WebConfig.cs
Global.asax
Startup.cs
Q15
Q15 How does MVC architecture improve testability?
By integrating tightly coupled components
By separating concerns
By reducing dependency injection
By optimizing Razor syntax
Q16
Q16 What is the role of Global.asax in the MVC lifecycle?
Handles database configuration
Manages application-level events
Defines view helpers
Routes data binding
Q17
Q17 Which method in RouteConfig.cs is used to register routes?
RegisterRoutes()
AddRoutes()
ConfigureRoutes()
MapRoutes()
Q18
Q18 You notice that a custom route is not being matched. What could be the issue?
Incorrect route order
Missing Model binding
Controller method is missing
Invalid View syntax
Q19
Q19 What is the main purpose of a Controller in MVC?
Manage user input
Render UI
Handle database connections
Route URLs
Q20
Q20 Which class do all Controllers in ASP.NET MVC inherit from?
System.Web.Mvc.Controller
System.Web.Mvc.Action
System.Web.Controller
System.Web.Mvc.Handler
Q21
Q21 How are actions in ASP.NET MVC defined?
As classes
As methods in a controller
As Razor views
As delegates
Q22
Q22 Which attribute is used to restrict an action method to HTTP POST requests?
[HttpPost]
[HttpGet]
[HttpMethod]
[PostOnly]
Q23
Q23 What does the ActionResult class represent in ASP.NET MVC?
The route configuration
The result of an action method
The Razor view file
The Controller's input
Q24
Q24 What is the role of the RedirectToAction method in a Controller?
Redirect to a view
Redirect to another action
Return JSON data
Handle errors
Q25
Q25 Which return type is used to render a view in an ASP.NET MVC action?
ViewResult
PartialView
FileResult
JsonResult
Q26
Q26 How do you return JSON data from a Controller action?
return Json(data);
return JsonResult(data);
return View(data);
return JSON.stringify(data);
Q27
Q27 How do you pass data from a Controller to a View in ASP.NET MVC?
Using ViewData or ViewBag
By creating a model class
Through Web.config
By using a query string
Q28
Q28 A Controller action is returning a 500 error. What could be a likely cause?
View is missing
Route is undefined
Unhandled exception
Incorrect HTTP method
Q29
Q29 A Controller method is not executing despite being properly defined. Why?
Incorrect route
Action name mismatch
No HTTP attribute specified
Model is missing
Q30
Q30 A Controller returns an incorrect View. What could be a possible issue?
The View file name is incorrect
The action method has no return type
RouteConfig is missing
A database error occurred