Loading...

The Free Online Tutorials, and Always will be.

MVC Interview Questions

What is MVC in ASP.NET ?


ASP.NET is a web application framework
MVC divides the web application into three seperate components for easy create and maintain application easily. MVC stand for Model View Controller.
Model - it represents a data layer which is used for store the data for web application.
View - it represents a presentation layer which is used in web application that acts as a UI (user interface) to the user.
Controller - it represents a business logic layer which is used for fetching and sending the data from and to the data layer and presents in the View layer.

Explain the page life cycle of MVC web applications ?


1. App Initialization ->
2. Routing -> routing is used to matching an incoming request to a pre defined URL.
3. Instantiate and execute Controller -> the mvc framework handles the route data by assign a pre defined controller that handle the requests.
4. Locate and Invoke Controller action -> after the controller has been created a component called the action invoker finds and selects an appropriate Action method to invoke the controller.
5. Instantiate and render view -> after preparation of action result based on condition the mvc seperates the decalring result and render view based on Result Execution or View Engine

Advantages of MVC over ASP.NET web applications ?


1. by seperating the web app in three layers of Model(data layer), View(presentation layer) and Controller(business logic layer) now app becomes easy to maintain and develop.
2. easy to debug the web app.
3. component approach in MVC encourages reausablity of the of the code in other apps also.
4. improve the standard of the structuring of the code.

What is Routing in ASP.NET MVC ?


Routing is a pattern