What is MVC Framework?

Prem Prem on 3/27/2024 4:37:07 PM

MVC Framework

The MVC architectural is most used development pattern in software engineering. All most all programming languages use MVC with slight variation, but conceptually it remains the same.

The Model-View-Controller (MVC) architectural pattern separates an application into three main components: the model, the view, and the controller

Model View Controller (MVC)

MVC is used to decouple user-interface (view), data (model), and application logic (controller). This pattern helps to achieve separation of concerns.

Using the MVC pattern for websites, requests are routed to a

Controller that is responsible for working with the Model to perform actions and/or retrieve data.

The Controller chooses the View to display and provides it with the Model.

The View renders the final page, based on the data in the Model.

 ASP.NET MVC framework

ASP.NET gives you a powerful, patterns-based way to build dynamic websites using the MVC pattern that enables a clean separation of concerns.

The ASP.NET MVC framework is a lightweight, highly testable presentation framework that (as with Web Forms-based applications) is integrated with existing ASP.NET features, such as master pages and membership-based authentication. 

The MVC framework is defined in the System.Web.Mvc assembly.

MVC architecture supported in ASP.NET

MVC stands for Model, View, and Controller. MVC separates an application into three components - Model, View, and Controller.


Model represents the shape of the data. A class in C# is used to describe a model. Model objects store data retrieved from the database.

Model represents the data.


public class Person
    public int PersonId { get; set; }

    public string Name { get; set; }

    public string PhoneNumber { get; set; }

    public string Email { get; set; }


View in MVC is a user interface. View display model data to the user and also enables them to modify them. View in ASP.NET MVC is HTML, CSS, and some special syntax (Razor syntax) that makes it easy to communicate with the model and the controller.

View is the User Interface.


<table class="table">
@foreachf(var item in Model)


The controller handles the user request. Typically, the user uses the view and raises an HTTP request, which will be handled by the controller.

The controller processes the request and returns the appropriate view as a response.

Controller is the request handler.


public class PeopleController : Controller
    private readonly DBContext _context;

    public PeopleController(DBContext context)
        _context = context;

    // GET: /people
    public async Task Index()
        return View(await _context.People.ToListAsync());

0 Comments on this post

Comments(0)||Login to Comments

InterServer Web Hosting and VPS
  • see more..