How to: Read HTML Attributes for Controls in Web Forms Pages
This example reads the attributes rendered for a TextBox Web server control and an HtmlInputButton control. The code reads the Keys collection of the AttributeCollection object of each individual control. For each key item, the code extracts the corresponding value by getting the value of the corresponding Item element.
This example requires:
-
An ASP.NET Web page.
-
A Button Web control named Button1.
-
An HtmlInputButton control whose ID attribute is set to Submit1.
Show: