Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Most of you already know that the output of ASP.NET web forms is quite ugly when you compare it to the output of ASP.NET MVC.

My question is what could the problems of that ASP.NET web forms' output cause to the end users? Is it the slow of browsing and the load time?, but do you think that could be a problem in today's high speed connections?

I want to choose an easy way to develop websites and I find ASP.NET web forms to be easier than ASP.NET MVC and I wonder if the problems of the output (ugly HTML, etc) can be a real problem for me?

share|improve this question
add comment

2 Answers 2

Choosing MVC over Web Forms because of the HTML footprint is like choosing to wear a seatbelt while driving because you can clip your mobile phone to it.

There are LOTS of reasons to wear a seatbelt, the least of which is because it's a handy place to clip your mobile phone.

MVC completely changes how you write web apps, and it's in a good way.

The important things it gives us is separation of concerns, and unit-test ability. I've recently campaigned here in work to start writing new Web Apps with ASP MVC (I'm currently implementing a prototype), and reduced HTML output wasn't even one of the reasons I put forward in my recommendation to management and the other developers.

The other reasons carried enough weight on their own.
We're introducing more and more unit testing here (folks are starting to see the benefit of it), also we recently took a hit trying to make an old WebForms app stateless, MVC is stateless out of the box. These were the main selling points here.

All that said, WebForms are perfectly fine, and work perfectly well.

share|improve this answer
    
SoC and Testability have little to do with the front-end code you use and everything to do with how your back-end logic is organised. Admittedly, MVC makes it easier to unit test display logic (this is also possible in WebForms, just more confusing and complicated to do), but saying MVC is better than WebForms because it makes your SoC and Unit testing better is like saying that bikes are better than cars because bikes have wheels. –  Ed Woodcock Jun 8 '11 at 9:21
add comment

Don't forget, we may have high speed connections today, but we also have an increasing amount of mobile web browsing. And on mobile devices, you can't take high speed for granted, and indeed excessive bandwidth usage may cost your visitors actual money.

Having said that, using WebForms doesn't have to mean ugly HTML or wasteful use of bandwidth. But you do need to be aware of issues like mangled IDs of runat="server" controls, excessive storage in the ViewState, complex controls that generate verbose markup with excessive inline styles, etc. etc.

You may find that when you need to care about enough things that affect the quality of WebForms' output, you no longer find them to be "easier than ASP.NET MVC".

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.