Traditional ASP .NET Web Forms vs MVC

后端 未结 8 1843
眼角桃花
眼角桃花 2020-11-29 07:41

As someone with some winforms and client applications experience - is it worth going back and learning the way traditional ASP .NET pages work, or is it okay with moving str

相关标签:
8条回答
  • 2020-11-29 07:49

    ASP.Net Webforms is a completely different abstraction over the base framework than ASP.NET MVC. With MVC you've got more control over what happens under the covers than with ASP.NET Webforms.

    In my opinion learning different ways to do things will usually make you a better programmer but in this case there might be better things to learn.

    0 讨论(0)
  • 2020-11-29 07:49

    If you don't know how or haven't has experience with raw level web request / response and raw html/css rendering then MVC will would be good place to start. You will then better understand the pros and cons of both webforms and mvc. They will both be around in the future as the both address different needs.

    Though I will say webforms is a highly misused and abused platform. So much of the "look no code" rubbish gives all who use it a bad name. Put in the time to understand it and use it properly you'll find its a very extensible and robust platform.

    0 讨论(0)
  • 2020-11-29 07:51

    It depends on your motivations. If you're going to sell yourself as an ASP.NET developer, you will need both.

    If this is just for your own pleasure, then go to MVC.

    My personal feeling is that webforms will be around for quite a few years more. So many people have time and energy invested in them. However, I think people will slowly (or maybe not so slowly!) migrate. Webforms was always just a way to get drag-and-drop VB4 morts to think about web development. It kindof worked but it does take away alot of control.

    0 讨论(0)
  • 2020-11-29 07:59

    ASP.NET MVC is for developers who desire to decouple the client code from the server code. I have wanted to write JavaScript, XHTML, CSS clients that can move from server to server (without regard to server technology). Clients are time-consuming to fit and finish so you would want to use them (and sub-components) for as many servers as possible. Also this decoupling allows your server to support any client technology that supports HTTP and angle-brackets (and/or JSON) like WPF/Silverlight. Without ASP.NET MVC you were forced into a hostile relationship with the entire ASP.NET team---but Scott Guthrie is a cool dude and brings MVC to the table after years of his predecessors (and perhaps Scott himself) almost totally focused on getting Windows Forms programmers to write web applications.

    Before ASP.NET MVC, I built ASP.NET applications largely based on ASHX files---HTTP handlers. I can assure you that no "real" Microsoft shop would encourage this behavior. It is easier from a (wise) management perspective to dictate that all your developers use the vendor-recommended way of using the vendor's tools. So IT shops that are one or two years behind will require you to know the pre-MVC way of doing things. This also comes in handy when you have a "legacy" system to maintain.

    But, for the green field, it's MVC all the way!

    0 讨论(0)
  • 2020-11-29 07:59

    I can't really speak technically about MVC vs "traditional" as I have only used the traditional model so far. From what I have read though, I don't think one is vastly superior to the other. I think once you "get it", you can be very productive in both.

    Practically though, I would take into consideration that most books, code samples and existing applications out there are written for the "traditional" way. You have more help available and your skills will be more useful for employers with existing applications written in the "traditional" way.

    0 讨论(0)
  • 2020-11-29 08:03

    IMO, there are more pitfalls in normal web forms scenarios than with just MVC. Viewstate and databinding can be tricky at times.

    But for MVC, it's just plain simple form post/render things old-school way. Not that it is bad, it is just different, and cleaner too.

    0 讨论(0)
提交回复
热议问题