29674

what is the difference between the asp.net mvc application and asp.net web application

can any one explain the difference between the mvc and web application in asp.net. in mvc we can find controllers folder. cant we able to find controllers folder in web application..! please vanish my confusion.

Answer1:

An ASP.NET MVC application is an application which depends upon the ASP.NET MVC Framework. MVC stands for Model, View Controller, the three components which define an application created using the MVC pattern.

The MVC pattern aims to seperate an applications logic, data and presentation into distinct, somewhat independent components.

<strong>Model</strong>

Models are a representation of an application's data. For example a shopping application might have a Cart model to represent the state of a user's shopping cart.

<strong>View</strong>

A view is a visual representation of the data contained in the model. A view class should knoow the specifics of how the model(s) it uses should be presented.

<strong>Controller</strong>

The Controller's job is to handle user input and update the state of the Model to reflect the changes that were made as a result of user action. For example imagine the user is viewing a Contact Us page and clicks the Submit button. The controller would respond to the button click by updating the model with values from the form fields and then save the model, causing it to be validated and then written to the database.

This is a very shallow and incomplete explaination of the MVC pattern you should head over to the ASP.NET MVC homepage to get a more complete view of the MVC pattern and the ASP.NET MVC framework.

An ASP.NET Web Application uses a separate framework known as Web Forms. Because Web Forms does not use the conventions defined in the MVC pattern, the Web Application template does not create a similar folder structure .

The use of either framework is not mutually exclusive, the two represent differing approaches to the same problem. With respect to which is most efficient for data access I would refere you to Michael Shimmins' excellent comment

Answer2:

MVC uses controllers to orchestrate the models and views to provide user interfaces to the user.

Web forms doesn't use controllers to achieve this, it uses code behind with events.

MVC is built around the notion of separation of concerns - each thing is responsible for its own bit, and shouldn't be concerned with what other bits are doing. Webforms has them a bit more mushed together, where code sits associated 1:1 with the webform (in the code behind), often leading to business logic creeping into the UI.

WebForms uses a powerful eventing system to help abstract away some of the complexities of HTTP, such as its stateless nature. MVC doesn't do this, which requires the developer to work within the confines of a pure HTTP environment. The eventing system in WebForms lets you quickly wire up events in a familiar way if you've come from a VB6/WinForms background (which the target audience had when ASP.NET was first released).

Have a look at http://www.asp.net/mvc which has a lot of great tutorials on getting started with MVC.

Recommend

  • Python Pandas Mixed Boolean Yes/True and NaN Columns
  • Error when starting JBoss 5.1.0.GA / AttachmentStore
  • Is there a filesystem plugin available for django?
  • How to setCenter mapview with location in google maps sdk for iOS
  • Setting Action Bar Item Text Color?
  • Could not install package 'Microsoft.Owin.Security 2.0.1'
  • PyYaml parses '9:00' as int
  • How to force refresh on CallLog.Calls.CACHED_NAME column?
  • SearchView WITHOUT ACTIONBAR [duplicate]
  • Submission of new app with iAds
  • Calling a constructor through reflection in scala 2.10
  • Returning this from a constructor function in JS
  • css background images not always displayed
  • testing a POST using phpunit in laravel 4
  • Most efficient way to move table rows from one table to another
  • Getting the scrolling offset when storing coordinates
  • How do I get the list of bad records that didn't load in Bigquery?
  • Bootstrap (v3.3.4) glyphicons not displayed in IE when refresh page (F5)
  • how do i write assembly code from c#?
  • Implementing “partial void” in VB
  • Sending HTML Form Data to Spring REST Web Service
  • x64 applications using gdi+: what are the consequences on performance?
  • Could not find rake using whenever rails
  • Django rest serializer Breaks when data exists
  • FFmpeg Conversion Error
  • Q promise. Difference between .when and .then
  • How to rebase a series of branches?
  • Java Scanner input dilemma. Automatically inputs without allowing user to type
  • Azure Cloud Service Web Role web pages do not load
  • Calling of Constructors in a Java
  • php design question - will a Helper help here?
  • Matrix multiplication with MKL
  • retrieve vertices with no linked edge in arangodb
  • using conditional logic : check if record exists; if it does, update it, if not, create it
  • AngularJs get employee from factory
  • Understanding cpu registers
  • IndexOutOfRangeException on multidimensional array despite using GetLength check
  • Authorize attributes not working in MVC 4
  • Add sale price programmatically to product variations
  • Binding checkboxes to object values in AngularJs