It is possible to add complex content (i.e., server controls and HTML elements) in a RadImageButton
instead of plain text. There are three ways to achieve this:
- Set the ContentTemplate property.
- In the markup of your page you can add controls to the ContentTemplate inner property as shown below:
- In the code-behind, you can set the ContentTemplate property to an instance of a class that implements the ITemplate interface.
- Add controls to the Controls collection of the RadImageButton instance from the code-behind.
Important: As a best practice we would advise using simple, inline HTML in the ContentTemplate of the RadImageButton control. This will ensure better usability, improved performance and flawless appearance.