HTML Controls

At first sight, HTML server controls look like HTML tags except for the extra runat=server attribute. Although it's true that they look the same, the additional runat attribute makes a huge difference. As mentioned, in ASP.NET by simply adding the runat attribute, you can bring to life otherwise-dead HTML text. Once transformed into a living instance of a server-side component, the original tag can be configured programmatically using an object-oriented approach. By design, HTML controls expose a set of methods and properties that carefully reflect the HTML syntax. For example, to set the default text of an input form field you use a property named Value instead of the more expressive Text. The name of the server control is determined ...

Get Programming Microsoft® ASP.NET 3.5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.