Course Recommendations:
ASP.NET HtmlGeneric Control
Definition and Usage
The HtmlGeneric control is used to control other HTML elements that are not specified by specific HTML server controls, such as <body>, <div>, <span>, <font>, <p>, and so on.
The HtmlGeneric control is used to control other HTML elements that are not specified by specific HTML server controls, such as <body>, <div>, <span>, <font>, <p>, and so on. | Properties |
---|---|
Description | Attributes |
Returns all attribute names and value pairs of the element. | Disabled |
Boolean value indicating whether the control is disabled. The default is false. | id |
The unique id of the control. | InnerHtml Special characters will not be automatically converted to HTML entities. |
InnerText | Sets or returns all text between the start and end tags of the HTML element. Special characters will be automatically converted to HTML entities. |
runat | Specifies that the control is a server control. It must be set to "server". |
Style | Sets or returns the CSS properties applied to the control. |
TagName | Returns the tag name of the element. |
Visible | Boolean value indicating whether the control is visible. |
Example
- HTMLGeneric
- In this example, we declare an HtmlInputText control, an HtmlInputButton control, and an HtmlGeneric control (the <p> tag) in the .aspx file. Remember to nest this control within the HtmlForm control. When the submit button is triggered, the submit subroutine will be executed. The submit subroutine will write a welcome message to the p element.