HTML control properties, html Control

Source: Internet
Author: User

HTML control properties, html Control

HTML controls can be divided into HTML input controls and HTML container controls based on their purposes in forms. As each HTML control has a large number of common attributes, it also has its own unique attributes, these attributes can be divided into three types: common attributes of HTML controls, common attributes of HTML input controls, and common attributes of HTML container controls.

1. Attributes shared by HTML controls

All controls in HTML have Attributes such as Attributes, Disabled, Style, TagName, and Visible.

Attributes Attribute, used to obtain a set of all Attribute names and value pairs on the server control flag on the selected ASP. NET page. You can use this property to access the features of HTML server controls programmatically. All HTML server controls store their features in Control. ViewState.

The Disabled attribute, used to obtain or set a value that indicates whether the HTML Server Control is Disabled. Syntax:

<Asp: HtmlControlDisabled = "true | false"/>

If the control is disabled, the value is true. Otherwise, the value is false. The default value is false.

Style attribute to obtain the set of CSS attributes of all Cascading Style Sheets applied to the specified HTML Server Control in the ASP. NET File

TagName attribute to obtain the element name that contains the tag of the runat = "server" attribute

Obtain or set a value indicating whether the HTML Server Control is displayed on the page.

2. Attributes shared by HTML input controls

In addition to attributes of all HTML controls, the HTML input control also has the following attributes:

Name attribute, used to obtain or set the unique identifier Name of the HtmlInputControl Control

Value Attribute, used to obtain or set the Value associated with the HtmlInputControl control. Syntax:

<Asp: HtmlInputControlValue = "String"/>

Type attribute, which defines the rendering Type or acquisition or Type of the HtmlInputControl control on the webpage. For example, if the value of this attribute is Text, the HtmlInputControl control is a Text box.

3. HTML container controls share attributes

The HTML container control maps to HTML elements. These elements must have the start and end tags, such as <a> and

The InnerHtml attribute is used to obtain or set the content between the start tag and end tag of the specified HTML Server Control. It automatically encodes special characters in and out of HTML objects. HTML entities allow special characters to be displayed. Generally, browsers interpret these characters as special characters. The "<" character is interpreted as the beginning of the flag and is not displayed on the page. To display "<", you need to use the object & lt. Syntax:

<Asp: HtmlContainerControlInnerHtml = "String"/>

The InnerText attribute is used to obtain or set the text between the start mark and end mark of the HTML Server Control. Unlike the InnerHtml attribute, the InnerText attribute does not encode special characters that automatically enter or exit the HTML object. Therefore, it is usually used when no special characters are displayed. Syntax:

<Asp: HtmlContainerControlInnerText = "String"/>

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.