263

The principles that you cited in your question are just that... principles. They are not mandates, laws or orders. While the people who came up with these principles are very smart, they are not absolute authorities. They are just people offering their insights and guidance. There is no "correct" way to program. This is evidenced by the fact that the "...


188

I developed ASP .Net WebForms applications for 3 years, and after one day of doing an MVC tutorial I was sold. MVC is almost ALWAYS the better solution. Why? The page lifecylce is simpler and more efficient There is no such thing as controls besides html controls. You don't need to debug your output to see what ASP .Net is generating. ViewModels give you ...


105

Webforms vs. MVC seems to be a hot topic right now. Everyone I know touts MVC to be the next great thing. From my slight dabblings in it, it seems ok, but no I don't think it will be the end of webforms. My reasoning, and the reasoning as to why webforms would be chosen over MVC, has more to do with a business perspective rather than what one is better ...


80

I emailed Scott Guthrie, an MVC expert at Microsoft. And probably the most qualified man to answer this question. He was kind enough to reply: "Different customers look for different programming approaches, and a lot love WebForms and think it is great. Others love MVC and think it is great. That is why we are investing in both. " So, to me this ...


51

It is not uncommon. One thing to realize is that the software industry is incredibly diverse. Some companies are cutting edge. Leading universities and innovative software companies (even some labs in the big ones!) as well as blessed persons or groups like the gang of four analyze the problems occuring with the common ways to do things and invent new ...


45

I recently switched from using in-line SQL queries to using EF and here's what I've found: Pros Much faster to build the DAL (love not writing the SQL queries!) Much easier to maintain No longer need to remember to parse my input before building an in-line sql statement, which means less chance of a SQL injection attack (of course, it's still possible ...


44

This is a stale question with a lot of answers but none had the answer I would have expected to be listed. The short answer is: Use ASP.NET MVC if you intend to properly build a web application with modern programming conventions and industry embraced patterns for the ASP.NET platform. On the down side you will be expected to know how HTML and client-side ...


39

I am a complete and total convert to ASP.NET MVC and have not looked back, that said I do still have to maintain several very large WebForms apps. Here's my take on it: WebForms Use these when you have some serious heavy lifting to do with grids. The grid controls are really very nice when you have a simple dataset that fits nicely in a tabular format and ...


35

Creating new tables dynamically based on user input is usually not a good idea. If the basic structure of forms changes, all the dynamically created tables will need to be updated to include new columns or have old ones removed, and this can cause maintenance headaches. Then there's problem of knowing which table to query (which will probably lead to dynamic ...


29

Former Designer here, turned Dev, and I used to piss and moan about Web Controls too. Honestly, its MUCH cheaper for a designer to adjust their practices than for a .NET Developer to delve into a custom impelmentation of a GridView because the designer INSISTED that each TD have a 'rel' tag (or whatever). As Arseni Mourzenko very wisely pointed out, the ...


16

They use C# .Net Webforms and do almost everything within the Code Behind with very little External Classes There's your explanation right there. If you aren't aware, out-of-the-box Web Forms code is pretty much the polar opposite of OOP, SOLID, DRY, YAGNI, Design Patterns, SRP, etc. Even the official examples from Microsoft from a few years back would ...


15

My experience: Wrote CakePHP projects for one year. Completed a medium sized Webforms project over six months. Worked on a Windows Forms project for three years. After that experience, I tried writing another app using webforms, and got frustrated after struggling for about a day with how webforms attempts to shield the developer from the reality that they'...


14

multipart/form-data is a construct created for HTML forms. As you've discovered the positive of multipart/form-data is the transfer size is closer to the size of the object being transferred--where in a text encoding of the object the size is inflated substantially. You can understand that internet bandwidth was a more valuable commodity than CPU cycles when ...


12

Entity Framework is a productivity tool. Unless you have a good reason not to (E.G. you are on SQL 2000 or have no time to ramp up on the technology), then use the best tools at your disposal. That being said, I find the concept of Entities to translate very well to the MVC pattern's Model. While having a 1:1 relationship with Models and tables is a bad ...


12

How common is this within the software industry? Very common. About the same commonness as having a plumber destroy your plumbing, a carpenter delivering junk, or a cheap tailor making a bad-fitting suit. I.e., it's all human. There is a good reason why this happens: people who are not really trained (or not enthusiastic) having to implement something ...


11

Don't be so hasty I know dealing with other people's code really sucks, but you have to take into consideration that 1- you don't know the new MVC platform, and 2- down the road you will be wanting to remake it again. Consider that rebuilding the project also takes time away that you could use upgrading it. No Surprises People don't like surprises in the ...


11

I think that in Spain is a constant because when a developer passes many years in a company he (or she) is usually promoted to more management areas like analysis and project management. As a result no peer review is done and the code is usually written by less experienced people. The failures of these experienced people are never corrected: instead, their ...


10

The protocol may be stateless, but the app you write could maintain any state :)


9

The problems that I see: Non-standard way of working: you are coming up with your own, fairly non-standard way of working. Any new developers you hire will have to learn the details of your framework. Some of them may not like it (e.g. see some of the comments above), and refuse to work in it. As you go along, you will also keep (re-)inventing lots of ...


9

My observation is that WebForms is on the decline. There is a good reason for that. Having used WebForms extensively in the past, it's difficult to do something outside the box. In addition to the learning aspx controls and their proper usage, there is a lot of technical minutiae to learn about the page life cycle when going beyond basics. And in the end, ...


8

I prefer webforms because my background is windows development. Speed of developmnt is a key issue, and I can easily pass a problem to someone in india to fix overnight with forms, also, if I have a speed issue on a page, a really good book about asp.net speed is handy ( Rick Kiessig is the man ). webforms is for ex windows people mvc is for web people ...


8

There is a solution to your issues but it involves a design pattern change to MVP. This is an up-front investment of time that needs serious consideration before start. Basically, issues that you are experiencing is not new. In short, you need to introduce a view abstraction through interface that identifies the data model that the view supports. It is ...


8

Suppose you had made a User Control that you were going to use on many different pages. Part of the User Control is a link to the Home page. If you use the User Control on a page that is more than one level deep: i.e http://website/folder1/APageWithUserControlOn.aspx then this : <a href="./Home.aspx" runat="server"> Home </a> will resolve ...


7

My 2 cents is to always use ASP.NET MVC for new projects if you have the option. In my opinion, webforms is not a good way to develop web apps, period. I think abstracting away basic REST is bad, the entire postback model is bad, the way html/css is handed with a reliance on the GUI editor is bad, the emphasis on stuff like wizards and GUIs to set stuff up ...


7

HTTP is certainly an older technology that has become quite ubiquitous as the web became so. As a result people are extending this technology to do many things now with modern web apps were it can appear the statelessness of HTTP is an issue. Hence you see a lot of conveniences like viewstates. However it is also possible to code modern web apps in a ...


7

Webforms was designed in a time when people wanted web applications to look like windows applications. This was a dark time on the internet where developers were forced to learn page lifecycles and deal with horrible view states and 3rd party controls which would cause such bloat the very fabric of the internet would be shaken... That is Webforms, an ...


7

A colleague I'm working with insists this is WET code and a violation of the DRY principle since each page has to load JQuery individually. No. The jQuery library code is cached by the browser. If it's served from a CDN, it's essentially cached permanently, or until the version changes. So the impact of "code duplication" is effectively zero. The DRY ...


7

Some of the "best practices" that you learn in school aren't practical or cost-effective on real-world projects. One of the biggest changes I noticed was in formatting and comments. Most of my professors stressed the importance of extensively documenting your code, but in the real world, good code is often (not always!) self-explanatory, and more importantly ...


6

I have read all the answers and feels my personal experience would add something to the answers above. 3-4 years back, I developed 2-3 website projects using Webforms. Around that time, MVC wasn't around or i didn't heard of it. The development was naturally(I was coming from Win-forms development with no prior web development experience) fast for me, ...


6

I've not seen this consideration put forward amongst the existing 15 answers to this thread yet, but I think it's worth considering. From my experience Web Forms is more similar to Win Forms and WPF than MVC is. Given this, I think one might consider choosing Web Forms when the team has most experience in that kind of tech, or when the Web Forms project ...


Only top voted, non community-wiki answers of a minimum length are eligible