Title: When to use HtmlControls vs WebControls
Tags: asp.net
Question: I like HtmlControls because there is no HTML magic going on... the asp source looks similar to what the client sees.
I can't argue with the utility of GridView, Repeater, CheckBoxLists, etc, so I use them when I need that functionality.
Also, it looks weird to have code that mixes and matches:
<asp:Button id='btnOK' runat='server' Text='OK' /&gt;
<input id='btnCancel' runat='server' type='button' value='Cancel' /&gt;
(The above case in the event you wanted to bind a server-side event listener to OK but Cancel just runs a javascript that hides the current div)
Is there some definitive style guide out there? Should HtmlControls just be avoided?

Here is the accepted answer: It might be useful to think of HTML controls as an option when you want more control over the mark up that ends up getting emitted by your page. More control in the sense that you want EVERY browser to see exactly the same markup.
If you create System.Web.UI.HtmlControls like:
<input id='btnCancel' runat='server' type='button' value='Cancel' /&gt;
Then you know what kind of code is going to be emitted. Even though most of the time:
<asp:Button id='btnCancel' runat='server' Text='Cancel' /&gt;
will end up being the same markup. The same markup is not always emitted for all WebControls. Many WebControls have built in adaptive rendering that will render different HTML based on the browser user agent. As an example a DataGrid will look quite different in a mobile browser than it will in a desktop browser.
Using WebControls as opposed to HtmlControls also lets you take advantage of ASP.NET v2.0 ControlAdapters which I believe only works with WebControls, this will allow you programatic config driven control over the markup that gets emitted.
This might seem more valuable when you consider that certain mobile browsers or WebTVs are going to want WML or completely different sets of markups.

Here is another answer: well... i wouldn't use an html control if you don't need to do anything on it on the server. i would do
<input id='btnCancel' type='button' value='Cancel' /&gt;

Here is another answer: By adding runat="server" you can get access to any HTML controls in server side..
and I believe HTML controls are less weight compared to ASP.NET server controls..

Here is another answer: In my experience, there's very little difference. As Darren said, if you don't need server-side functionality, HTML controls are probably lower-impact.
And don't forget, you can bolt server-side functionality onto almost any HTML control just by adding a runat="server" directive and an ID to it.

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 4, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 2.5', 'CreationDate': '2008:00:09/11/08', 'FavoriteCount': 4.0, 'PostTypeId': 1, 'Tags': '<asp.net>', 'Title': 'When to use HtmlControls vs WebControls', 'ViewCount': 4755, 'id': 57958, 'user_AboutMe': '<p>I solve problems using mostly software and duct tape. At varying points, I\'ve been mainly writing Ocaml, Javascript, Python, F#, C#, PHP, and C. I\'m a generalist although some areas of interest include web security, cryptography, programming language design, healthcare data standards, procedural generation, and 3D engines.</p>\n<p><a href="https://blog.codinghorror.com/new-programming-jargon/" rel="nofollow noreferrer">A Terrible Programmer according to Stack Overflow</a></p>\n', 'user_AccountId': 3121.0, 'user_DisplayName': 'Jimmy', 'user_Reputation': 86697.0, 'user_Views': 4668.0, 'user_id': 4435.0}}