In web development, you often hear the terms "element" and "control". The term "element" is often associated with HTML, and you hear the term "control" most often in Asp.NET development... but the w3c refers to controls in the Forms in HTML documents recommendation, blurring the lines a little.

What is a control and what is an element? How are they the same and how are they different? Is one a generalization of the other?


Element refers to DOM Elements. In other words, every part of the page is an element. Javascript/DHTML is all about manipulating these elements to make the page interactive.

A control, in the W3C sense, is a type of element that accepts user input. Things like textboxes, radio buttons, and submit buttons are all controls under this definition.

The ASP.Net definition of a control is different from the W3C version. In ASP.Net, a control is a template that takes data and formats it as HTML. So, for example, a GridView control takes the data that you give it and formats it as a <table>. A Label formats data as a <span>. ASP.Net controls allow you to work at a higher level of abstraction than the W3C DOM. You can work with Labels, GridViews and Repeaters, rather than having to work out the HTML generation yourself.

  • That would of been my answer too! – webdad3 Mar 31 '11 at 14:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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