Reputation: 17981
Why would you consider using ASP.Net MVC or standard ASP.Net with forms and controls for a web project? Apart from personal preference what would be the reasons? What sort of projects do you find more suitable for MVC and what projects for normal ASP.Net?
Would you consider transferring your current projects to one or another?
Upvotes: 8
Views: 1547
Reputation: 2102
ASP.NET Web Forms and MVC are two web frameworks developed by Microsoft - they are both good choices. Neither of the web frameworks are to be replaced by the other nor are there plans to have them 'merged' into a single framework. Continued support and development are done in parallel by Microsoft and neither will be 'going away'.
Each of these web frameworks offers advantages/disadvantages - some of which need to be considered when developing a web application. A web application can be developed using either technology - it might make development for a particular application easier selecting one technology versus the other and vice versa.
ASP.NET Web Forms:
ASP.NET MVC:
Authentication, authorization, configuration, compilation and deployment are all features that are shared between the two web frameworks.
Upvotes: 13
Reputation: 964
You can find many differences, advantages about the ASP.Net MVC over the normal ASP.Net
Applications. if not kindly visit stack overlow page.
Biggest advantage to using ASP.Net MVC vs web forms
the reason for choosing the MVC concept for your application vary on many things
What for your application for ? either kind of forum, reporting tool or intranet website
Whether you want to follow desing pattern or not?
if yes, then whether is that going to be MVC or any other ??
Whether you need modularity for future enhancements?
Whether you need full control on your code?
Better support on the testing part from the developer perspective should be there or not?
If are sure about those things, then you can move ur appln to MVC framework model.
Other wise its better to continue with ASP.Net Web.apps, because it includes all the latest
features what the current industry needs.
Upvotes: 1
Reputation: 29956
WebForms is an abstraction which hides the mechanics of the web from the developer. It allows desktop developers to relatively easily transfer their skills to the web. Whilst it does achieve this in part, in practical scenarios it is usually not long before the abstraction breaks and one has to put in messy workarounds. Unit testing is difficult, because the logic for handling user interactions is tightly coupled with the UI. The HTML produced by a typical WebForms app is far from optimal. It is typically bloated, difficult to read and contains a lot of content which is present only to allow the abstraction to work, e.g. viewstate, which is a huge blob of information to help the abstraction give the illusion of state to the developer, even though the web is a stateless medium.
MVC, however, embraces the mechanics of the web. The fundamental operations which take place in a web request and response are presented to the developer as simple abstractions. MVC has a clear separation of concerns. The model simply represents the business objects or entities with which the system is concerned, with methods for retrieving and storing instances of these objects. The controller take a web request, performs operations against the model, and then hands the model to the view. The view is purely a renderer, for presenting the model to the user and exposing interface items which allow the user to formulate the next request to pass to a controller. This separation of concerns allows for relatively easy unit testing. The developer has complete control over the HTML produced and there is no need for other artifacts to be present (e.g. viewstate).
I prefer MVC. For rare occasions it may be useful to use Webforms, e.g. a quick prototype or demo, but otherwise I would always recommend the use of MVC.
As for transferring a project from Webforms to MVC, this is obviously very subjective and dependent on the application itself, and budgetary constraints, but in general I believe this is a step in the right direction.
Upvotes: 8