<p>I work with C# at work but dislike how with webforms it spews out a lot of JavaScript not including the many lines for viewstate that it creates.</p>

<p>That's why I like coding with PHP as I have full control.</p>

<p>But I was just wondering how this sites HTML is so clean and elegant?</p>

<p>Does using MVC have something to do with it? I see that JQuery is used but surely you still use asp:required validators? If you do, where is all the hideous code that it normally produces?</p>

<p>And if they arent using required field validators, why not? Surely it's quicker to develop in than using JQuery?</p>

<p>One of the main reasons I code my personal sites in PHP was due to the more elegant HTML that it produces but if I can produce code like this site then I will go full time .net!</p>

[{'answer_id': 12775, 'author': 'Dale Ragan', 'author_id': 1117, 'author_profile': 'https://Stackoverflow.com/users/1117', 'pm_score': 2, 'selected': False, 'text': '<p>You were on the right track.  It is the fact that they are using the ASP.NET MVC web framework.  It allows you to have full control of your output html.</p>\n'}, {'answer_id': 12781, 'author': 'Seibar', 'author_id': 357, 'author_profile': 'https://Stackoverflow.com/users/357', 'pm_score': 2, 'selected': False, 'text': "<p>Yes - MVC doesn't utilize the ASP.NET view state junk.</p>\n"}, {'answer_id': 12788, 'author': 'Zack Peterson', 'author_id': 83, 'author_profile': 'https://Stackoverflow.com/users/83', 'pm_score': 2, 'selected': False, 'text': '<p>The <a href="http://www.asp.net/mvc/" rel="nofollow noreferrer">ASP.NET MVC Framework</a> is an alternative to the normal "web forms" way of doing ASP.NET development.  With it you lose a lot of abstraction, but gain a lot of control.</p>\n'}, {'answer_id': 12789, 'author': 'Jon Galloway', 'author_id': 5, 'author_profile': 'https://Stackoverflow.com/users/5', 'pm_score': 4, 'selected': True, 'text': '<p>One of the goals of ASP.NET MVC is to give you control of your markup. However, there have always been choices with ASP.NET which would allow you to generate relatively clean HTML.</p>\n\n<p>For instance, ASP.NET has always offered a choice with validator controls. Do you value development speed over markup? Use validators. Value markup over development speed? Pick another validation mechanism. Your comments on validators are kind of contradictory there - it\'s possible to use ASP.NET and still make choices for markup purity over development speed.</p>\n\n<p>Also, with webforms, we\'ve had the CSS Friendly Control Adapters for a few years which will modify the controls to render more semantic markup. ASP.NET 3.5 included the ListView, which makes it really easy to write repeater type controls which emit semantic HTML. We used ASP.NET webforms on the Microsoft PDC site and have kept the HTML pretty clean: <a href="http://microsoftpdc.com/Agenda/Speakers.aspx" rel="nofollow noreferrer">http://microsoftpdc.com/Agenda/Speakers.aspx</a> - the Viewstate could probably be disabled on most pages, although in reality it\'s only a few dozen bytes.</p>\n'}]
['https://Stackoverflow.com/questions/12768', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1469/']