What is ASP.NET MVC?

ASP.NET MVC is a framework for developing web applications that follow Model-View-Controller Pattern.
It is built on top of the ASP.NET framework with an aim to enhance existing functionality. As a result, you can use features of ASP.NET while working on ASP.NET MVC applications.

Asp.net MVC

Asp.net MVC

Advantage of ASP.NET MVC

  • Enables the full control over the rendered HTML and its control.
  • Provides clean separation of concerns(SoC).
  • Enables Test Driven Development (TDD).
  • Easy integration with JavaScript frameworks and plugin.
  • Following the design of stateless nature of the web.
  • No ViewState and PostBack events

MVC Pattern

All the main 3 parts of asp.net mvc are explained in below section.

Model

Model is responsible for all the actual data processing related tasks, like database connection, querying the database.It provides data to the view without concern about the actual formatting and look and feel.

Data provided by Model is Independent of UI so it can also be reuse with as many other views without code redundancy. As a result, this makes maintenance easy and reduces bugs and allows code reuse at good extent.

Controller

Controllers are basically the central unit for your ASP.NET MVC web application. It interacts with incoming HTTP web Request.So, the controller determines which model will be selected, and then it takes the data from the model and process it and passes the same to the respective view after that view is rendered with correct UI. Actually, controllers act as a bridge which accepts the input and renders the proper output.

Controllers are C# classes which inherit from System.Web.MVC.Controller, it is the built-in controller base class of.Net framework.Each public method of the controller is known as an action method.

View

The View is the part of the application that handles the display of the data. it consists all required HTML tags.

Conclusion

Here I have tried to explain basics about asp.net MVC. You can learn more about some other topics related with asp.net mvc like ViewBag,ViewData and TempDate,HTML Helper

Leave a Reply

Your email address will not be published. Required fields are marked *

Name *
Email *
Website