Asp.Net MVC is the Microsoft web application development framework built on top of the .NET framework. It has several versions, and the latest one is the Asp.Net MVC 6.0. Before going to what is Asp.Net MVC, first, we discuss about what are the web application platforms Microsoft had introduced before Asp.Net MVC and what are the disadvantages of them which cause the implementation of Asp.Net MVC.
ASP: Microsoft first answer to web development was classic ASP (Active Server Page). ASP is the scripting language where code and markup authored together in a single file with the file extension as .asp. Each of this file corresponds to one web page. It was very popular, and many websites developed in ASP. However, later developers want many more features like code reuse, better separation of code from markup, and object-oriented programming principles…etc.
Asp.Net: After classic ASP, Microsoft introduced the Asp.Net in 2002. Asp.Net answered many of the developer’s requirements. Like classic ASP, Asp.Net also rely on file-based approach where each web page represents in the form of a physical file with extension .aspx. However, in Asp.Net there is a separation between code and markup. Markup file name extension is .aspx whereas code file name extension is like .aspx.cs. Many websites and web applications developed using Asp.Net. Still many developers are using Asp.Net web application development platform. Asp.Net has been serving for many years as web application development, but some developers Asp.Net web form approach is the too much abstraction underlying HTML content.
To fulfill the web developer’s need, Microsoft then developed the new web application development platform Asp.Net MVC. The first version of Asp.Net MVC got released in 2008, and the latest version is Asp.Net MVC 6.0.
Unlike Classic Asp and Asp.Net, Asp.Net MVC does not rely on page-based approach. Model, View, and Controllers play the main role in Asp.Net; in my next articles, we discuss more about each in further articles. In Asp.Net MVC, the controller receives the request and passes to Model. Model returns data to Controller; then Controller passes the data to View which displays the data by using HTML as shown below.
As indicated above, Controller receives the request from a user, it process and passes to Model if it has to return any data. Model is simply a class, and it can return any data. Once Model returns data, then controller simply passes the data to View. View just displays the data in HTML. The view does nothing other than displaying data as a template.
As of now we just discussed what Asp.Net MVC is, now we discuss about why we need Asp.Net MVC as already Asp.Net web forms is there for web application development.
Why Asp.Net MVC:
As of now, we discussed what Asp.Net MVC is and why we need Asp.Net MVC. In my next articles, we discuss Model, View, and Controller in-detail.