Tuesday, October 9, 2018

ASP.NET MVC Architecture

ASP.NET MVC  Architecture

 

Asp.net MVC introduced in .Net Version 3.5 in 2009 with the good features like MVC architecture, Ajax Helpers, html Helpers etc.  Asp.net MVC is a complete alternative to ASP.NET Web Forms. It builds on ASP.NET so you can get all features of asp.net while developing MVC applications. It is basically Web development Frame work from Microsoft. It is a lightweight and highly testable presentation Framework. 

Let’s understand the MVC Architecture
 
MVC pattern stands for Model, View and Controller.  MVC pattern is used SAC (Separation Application Concern), It splits the application into 3 components that is Model, View and Controller.


Model: Model represents an object and maintains the application data and Business logic.

Controller: it controls the both View and Model. It takes the appropriate user input requests coming from the browser and renders the appropriate View with Modal Data.

View: View is a user Interface of application that contains the data or Modal Data.
 

How Request Goes to Server and Response Back It?
 
  1. When the user enters the URL in the Internet Explorer(IE) / Chrome/ Mozilla Firefox or any other browser.     
  2.  First request goes to server and fire the Register Routes. Before that we need to register the “Register Routes” in Application_Start Event in Global.asax file
  3.   “Register Routes” is Static method in RouteConfig Class in App_Start Folder. In RouteConfig Class, we can find the parameters like NAME, URL, DEFAULT. Based on that parameter Route Engine selects the controller, action methods and executes the next step goes to Controller.
  4. Controller communicates with Model based on request. And maintaining the business Logic and Model Data
  5.  Controller Render the view to browser with model data.















 

No comments: