Shared HTML Control Properties
As part of the .NET Framework, ASP.NET shares inheritance across namespaces and classes. There are two subsets of HTML controls that share properties from distinct base classes. These subsets are referred to as container controls and input controls.
Any attribute declared on an HTML control is added to the control's Attributes collection and can be manipulated programmatically, just like a property. For example, if you declare a bgcolor attribute on a <body> element, you can programmatically access the attribute and write event handlers to change its value.
Properties Shared by All HTML Controls
Attributes |
Gets all attribute name/value pairs expressed on a server control tag within a selected ASP.NET page.
|
||
Gets or sets a value that indicates whether the disabled attribute is included when an HTML control is rendered on the browser. Including this attribute makes the control read-only. |
|||
Gets all cascading style sheet (CSS) properties that are applied to a specified HTML server control in an .aspx file. |
|||
Gets the element name of a tag that contains a runat="server" attribute. |
|||
Gets or sets a value that indicates whether the HTML server control is displayed on the page. |
Properties Shared by All HTML Input Controls
HTML input controls map to the standard HTML input elements. They include a type attribute that defines the type of input control they render on a Web page.
The HtmlInputText, HtmlInputPassword, HtmlInputButton, HtmlInputSubmit, HtmlInputReset, HtmlInputCheckBox, HtmlInputImage, HtmlInputHidden, HtmlInputFile, and HtmlInputRadioButton controls share the following properties.
Gets or sets a unique identifier name for the HtmlInputControl control. |
|||
Gets or sets the value associated with an input control.
|
|||
Gets the type of an HtmlInputControl control. For example, if this property is set to text, the HtmlInputControl control is a text box for data entry. |
Properties Shared by All HTML Container Controls
HTML container controls map to HTML elements that are required to have an opening and a closing tag, such as the <select>, <a>, <button>, and <form> elements.
The HtmlTableCell, HtmlTable, HtmlTableRow, HtmlButton, HtmlForm, HtmlAnchor, HtmlGenericControl, HtmlSelect, and HtmlTextArea controls share the following properties.
Gets or sets the content found between the opening and closing tags of the specified HTML control. The InnerHtml property does not automatically convert special characters to HTML entities. For example, the less than character (<) is not converted to <. This property is commonly used to imbed HTML elements in the container control. |
|
Gets or sets all text between the opening and closing tags of the specified HTML control. Unlike the InnerHtml property, the InnerText property automatically converts special characters to HTML entities. For example, the less than character (<) is converted to <. This property is commonly used when you want to display text with special characters, without specifying the HTML entity. |
See Also
Reference
HtmlInputControl
HtmlContainerControl
HtmlControl