Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Confused with ASP.Net MVC

Tags:

asp.net-mvc

I'm trying to figure out the difference between ASP.NET and ASP.NET MVC. Mode-View-Controller called a MVC is a development model/pattern/programming model, right? It is just a way the code can be written by a developer to have full control over the code. If that is the case what are MVC 1, MVC 2 etc. released by Microsoft and the 'special framework' for MVC pattern?

like image 998
NLV Avatar asked Feb 26 '23 19:02

NLV


1 Answers

The comparison you make is slightly awkward because ASP.NET is a platform, whereas ASP.NET MVC is a customization/enhancement of that platform to facilitate programming against established MVC paradigms and best practices.

That being said, ASP.NET WebForms takes a particular approach to building web applications: single-form pages and simulating 'state' via the (often dreaded) ViewState object. Meanwhile, ASP.NET MVC focuses on separation of concerns (presentation, business, and persistence logic) as well as 'out of the box' support for things like routing (clean URLs - no ugly .aspx) and model binding.

Each has its own benefits - ASP.NET Classic WebForms provides a plethora of available user controls to get up and running quickly. It is also arguably easier to pick up if you're coming from a Windows Forms or WPF background (since the code-behind and events appear very similar).

The MVC releases (1, 2, and 3) provide project templates, some starter code, and other goodies like support for other rendering engines (i.e. Razor). You will have to get your hands more dirty with JavaScript using MVC, but you have complete control over the generated markup, and the freedom to extend the framework however you see fit.

like image 156
Alex Avatar answered Mar 11 '23 21:03

Alex