Jump to content
skaterdav85

ASP.NET vs. ASP.NET MVC

Recommended Posts

I'm interested in learning asp.net and I keep seeing it referred to as asp.net mvc. I'm familiar with MVC as I have done some web development using a php framework and jsp/java/struts development. My question is, should i start learning the asp.net mvc framework while i dive into .net or should I start out learning asp.net without mvc first? I was under the impression that asp.net forced you to write apps using the mvc pattern, similar to the use of jsp, java, and servlets.

Share this post


Link to post
Share on other sites

You are not forced to use MVC, I personally use and prefer using Web Forms.If you have had experience wih MVC before then this will most likely help your transition to .NEThttp://www.asp.net has all the info you should need on MVC and Web Forms

Share this post


Link to post
Share on other sites

You can learn which ever you like but I would go with MVC. It just seems much more natural. I have used Web Forms for 5 years and have been transitioning away from it to MVC whenever possible. It is a matter of preference but I like the control I have in MVC.

Share this post


Link to post
Share on other sites

Due to the fact that both ASP.NET WebForms and ASP.NET MVC are two alternative frameworks (meaning that MVC is not mandatory and although came out later than WebForms does not actually replace it) of ASP.NET, they both share the .NET framework and the same essential runtime. Even though MVC adds on an additional runtime of sorts, to help with routing I believe...Anyway, it really comes down to personal preference.I'm starting new, currently, and am adopting MVC, but here are some very good pros and cons to both:WebForms:Pros- Allows rapid development of web applications- Doesn't require prior knowledge of HTMLCons- Rapid development leads to messy client ID outputs (or it can)- Masks the web (http's) true stateless environment- Although it can be tested, it does not provide intrinsic functionality like MVCMVC:Pros- Produces output with standards-compliant HTML- Separation of Concerns (everything has its own place like the Models, Views and Controllers that make up the "MVC" acronym) which leads to overall good development practices, extendability, maintainability and aids in projects where there is more than one person working on it. Say, the designer could be working on the views (the user-interface) while the developer or database-manager could be working with Models, etc, etc.- Easily testable with standard VS2010 (Visual Studio 2010) built-in and also support for many third-party testing platforms.Cons- Requires knowledge of HTML- Can be much slower to output a project than WebForms (due to its SoC nature)In the end, like I said before, this is really a personal question, however, in my opinion, it really depends on the project.Let's say you want to build a quick web application for a client, you may choose WebForms because you or your client or you and your client to particularly care about keeping HTML standards-compliant markup. However, if you would like to build a full-fledged ecommerce platform (although many use WebForms for this as well), you may choose MVC so that it could be maintained and extended so easily.Like I said previously, I'm just starting and although it's tempting to just use WebForms and piece together a web application real quick (because the drag and drop server controls really make this quite easy and fun! :) ), I really enjoy working with the MVC framework, just because it produces such clean code.Have fun and good luck!

Share this post


Link to post
Share on other sites

I've looked into both frameworks a little bit and I thought web forms was a terrible way to build web applications. It's full of page refreshes with postbacks on every user click. How do Web Forms not produce standards compliant HTML? I am pretty sure it would, although dragging and dropping components to produce HTML isn't the best way to develop markup.

Share this post


Link to post
Share on other sites
I've looked into both frameworks a little bit and I thought web forms was a terrible way to build web applications. It's full of page refreshes with postbacks on every user click. How do Web Forms not produce standards compliant HTML? I am pretty sure it would, although dragging and dropping components to produce HTML isn't the best way to develop markup.
Exactly, WebForms is tempting to many (including me) to use just because a relatively powerful web application can be produced quickly via the dragging and dropping of those server controls. It is definitely possible to develop a WebForms web application and still maintain a reasonably good handle of standards-based markup, however, almost always, an ASP.NET MVC web app will output far more standards-compliant markup than WebForms.And yes, I completely agree with page refreshes and postbacks on every user click. Like I mentioned in my previous post, WebForms attempts to veil the naturally stateless nature of the web environment, whereas MVC accepts that the internet is stateless, and therefore does not include postbacks with many page refreshes in its framework.And like I said before as well, they are both a great way (in my opinion of course) to develop dynamic web applications. I myself have been trying to get my head wrapper around the MVC architecture just because I think the Separation of Concerns is very valuable as far as maintainability and extendability. To give an example, think about if you wanted to develop an eCommerce site by scratch. Although easy to do in WebForms, with ASP.NET MVC, you could reuse that Model logic that you developed to build your eCommerce platform, for another new eCommerce website, while updating your Views to match the new look of the site. Additionally, when attempting to make a change to your entire web application's architecture, you will know where to look when you are hunting for that specific line of code, as opposed to WebForms, where it may be buried.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×