# Templates Overview

Templates allow you to embed any context inside a RadDropDownListItem. For example:

* HTML markup

* ASP.NET server controls

* other third-party controls (other Telerik RadControls for ASP.NET Ajax for example)

## Example

> caption Example: Render item text and images with a server template

Shows how to use templates to create the following RadDropDownList:

An <ItemTemplate> section is added to the **RadDropDownList** declaration. The image in the template and the text that appears in the template is taken from the RadDropDownListItem using <%# DataBinder.Eval %> statements.

```C#
<telerik:RadDropDownList RenderMode="Lightweight" ID="RadDropDownList1"
	 runat="server">
	<ItemTemplate>
		<table >
		<tr>
			<td>
				<img src='Images/<%# DataBinder.Eval(Container, "Attributes['ImagePath']") %>' alt='<%# DataBinder.Eval(Container, "Text") %>' />
			</td>
			<td>
				<%# DataBinder.Eval(Container, "Text") %>
			</td>
		</tr>
	</table>
	</ItemTemplate>
	<Items>
		<telerik:DropDownListItem ImagePath="additionOperation.png" Text="Sign for Adding" />
		<telerik:DropDownListItem ImagePath="substractOperation.png" Text="Sign for Substracting" />
		<telerik:DropDownListItem ImagePath="multiplyOperation.png" Text="Sign for Multiplying" />
		<telerik:DropDownListItem ImagePath="divideOperation.png" Text="Sign for Dividing" />
	</Items>
</telerik:RadDropDownList>
```

Before the template can use the RadDropDownList item's properties to bind the elements in the template, the application needs to explicitly bind the items by calling **DataBind** method of **RadDropDownListItem** objects.

```C#
protected void Page_Load(object sender, EventArgs e)
{
	// Bind each item so its template expressions can access item properties.
	for (int i = 0; i < RadDropDownList1.Items.Count; i++)
	{
		RadDropDownList1.Items[i].DataBind();
	}
}
```

```VB
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load

	' Bind each item so its template expressions can access item properties.
	Dim i As Integer = 0

	While i < RadDropDownList1.Items.Count
		RadDropDownList1.Items(i).DataBind()
		i = i + 1
	End While

End Sub	
```
