What is MVC (Model View Controller)?
Answer:
MVC is an architectural pattern which separates the UI and Data Model and business logic. It’s divided into three parts, Model, View, and Controller.
1. The Model represents the data and pass it to view (Database objects).
2. The View displays the data and responsible for look and feel of the page (from database).
3. The Controller handles the user input(request) and load appropriate model and view.
What are the advantages of MVC?
Answer:
Multi view support
Due to the separation of the model from the view, the user interface can display multiple views of the same data at the same time.
Separation of Concerns
Separation of Concerns is one of the core advantages of ASP.NET MVC .Since code-behind concept has been removed from MVC
The MVC framework provides a clean separate logic for the UI, Business Logic, Model or Data.This feature enable code re-usability.
Read More...
Q.Explain “page lifecycle” of an ASP.NET MVC?
Answer:
MVC is an architectural pattern which separates the UI and Data Model and business logic. It’s divided into three parts, Model, View, and Controller.
1. The Model represents the data and pass it to view (Database objects).
2. The View displays the data and responsible for look and feel of the page (from database).
3. The Controller handles the user input(request) and load appropriate model and view.
What are the advantages of MVC?
Answer:
Multi view support
Due to the separation of the model from the view, the user interface can display multiple views of the same data at the same time.
Separation of Concerns
Separation of Concerns is one of the core advantages of ASP.NET MVC .Since code-behind concept has been removed from MVC
The MVC framework provides a clean separate logic for the UI, Business Logic, Model or Data.This feature enable code re-usability.
Read More...
Q.Explain “page lifecycle” of an ASP.NET MVC?
When a page is requested first following process are performed by ASP.Net MVC
Step 1: Routing
In traditional ASP.NET webform application each asp.net page implements the IHTTPHandler interface.
This interface has a ProcessRequest() method that gets called when you request the page. The ProcessRequest() method is responsible for processing the request and generating the response. So in asp.net application it is simple, you request for a page in the url like http://mylocalsite1\default.aspx and then it search for that page on the local disk and execute the processrequest method and generate the html response.
However in MVC application ,request response process is different from webform. In MVC there are no physical page exist for a particular request. All the requests are routed to a special class called Controller. The controller is responsible for generating the response and sending the content back to the browser.
When you build a MVC application you can define a bunch of controllers. Each controller can handle multiple requests. For example, all the following will route to same Controller.
http://mylocalsite1/Controller1/2
http://mylocalsite1/Controller1/3
|
0 comments:
Post a Comment