tags:

views:

239

answers:

6

Im staring to get into .NET development for the web. I want to learn the best way to build web sites using c#. I began reading about 'web forms' but then came across some new 'mvc' way of building web sites.

Which one should I learn?

Thanks for any feedback provided.

+1  A: 

Depends very much on your background and what kind of websites you wish to build.

I'd suggest looking at this post for more info.

dommer
+1  A: 

There's no reason one has to preclude the other. Both are important, both have a use. I would recommend that you learn the basics of each and then perhaps re-ask your question as it pertains to your specific scenario. You can get enough of a familiarity with both concepts by reading a couple of articles on each, or just search through SO for other questions about the topics.

Elie
+9  A: 

learn both

Steven A. Lowe
+1  A: 

MVC (Model-View-Controller) has become a common web application pattern, and learning it will allow you to transfer your knowledge to other MVC frameworks more easily in the future. Many also find MVC to be a simpler and easier to grasp model. The Web Forms model has often been a source of frustration for many because, in their opinion, it adds too many "leaky abstractions" between the development envirnment and the underlying HTTP stack. For these reasons, I prefer MVC.

Mike Pond
+2  A: 

You can seriously do everything with MVC Framework that you can with WebForms. If you live in a perfect world where all your development is new development then go with MVC Framework. However if you live in the world that has legacy apps, they will probably be in webforms. So to sum up what another posted put, you'll need to learn both.

Al Katawazi
+1  A: 

I agree...both of these technologies are useful and worth learning today.

If you've spent time building UI's in Windows Forms, you may find the event-driven model of Web Forms more comfortable. Since the Web Forms technology was designed to abstract away the HTTP/browser stack, you may find that this enables you to get down to business pretty quickly. In addition, the supporting tooling, documentation, and training resources are very mature. That said, you can find yourself hitting the wall pretty quickly with this model once things get complex.

MVC may involve a little more work up front getting to know the composite parts, but it gives you a lot more freedom than Web Forms in controlling the output. You will take on some more responsibility of learning how the HTTP and browser stack work, but the tools will get in your way a lot less. The tools also tend to enforce much cleaner separation of concerns in your code, making for easier testing and debugging.

Scroll Lock