The Model-View-Controller (MVC) architectural pattern separates an application into three main components: the model, the view, and the controller. The ASP.NET MVC framework provides an alternative to the ASP.NET Web Forms pattern for creating Web applications. The ASP.NET MVC framework is a lightweight, highly estable 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.
Model: Model represents shape of the data and business logic.It maintains the data of The application. Model objects retrieve and store model state in a database. Note - Model is a data and business logic. View: View is a user interface. View display data using model to the user and also enables them to modify the data. Note - View is a User Interface.
Controller:
Controller handles the user request. Typically, user interact with View, which in-tern raises appropriate URL request, this request will be handled by a controller. The controller renders the appropriate view with the model data as a response.
Note - Controller is a request handler.
MVC Architecture
The following figure illustrates the flow of the user's request in ASP.NET MVC See Above-.
Request/Response in MVC Architecture
As per the above figure, when the user enters a URL in the browser, it goes to the server and calls appropriate controller. Then, the Controller uses the appropriate View and Model and creates the
0 comments :
Post a Comment