Thursday 29 August 2013

What is MVC in Asp.net.

The Model-View-Controller architectural pattern separates an appliaction into three component : The Model,The View and The Controller.The Asp.Net MVC framework is an alternative to the Asp.Net web form pattern for creating MVC based web application.
It is a light weight framework, highly testable presentation framework that is integrated with existing Asp.Net feature, such as master page and form authentiactions.The MVC framework is defined in System.Web.Mvc namespace.

Understanding  Model:-
An MVC model contains all of your application logic that are not contained in Views or Controller. The Model contains all of business logic, database access logic and validation logic.
For example, If you are using Microsoft Entity Framework to access your database, then you would create your entity framework class (.edmx file) in the model folder.

Understanding  View:-
A view contain html markup and content that is sent to the browser. A view is equivalent to the page when working with an asp.net MVC.

Understanding  Controller:-
A controller is responsible for controlling the way user interacts with MVC appliaction. A controller contains the flow control logic for MVC appliaction. A controller determines what reponse to send back to the user when a user make a browser request.
Controller is just  a class(.cs file).



                   

No comments:

Post a Comment

Note: only a member of this blog may post a comment.