In the. aspx file, insert the element into the control to identify the template you are creating:
In the template element, add HTML text and other controls as the contents of the template. Includes properties and data-bound values for embedded controls that use general syntax:
Name: text= "<%# Container.DataListItem.Name%>"/>
Repeat steps 1 and 2 for each template that you want to create.
The following example shows a full declaration of the DataList Web server control with a simple template declared for the Header, Item, and Separator templates.
Items matching your query:
Name: Text= ' <%# DataBinder.Eval (Container, "Dataitem.employeename")
%> ' >
Note If the Web Forms designer does not render a Web server control correctly, it displays a gray box showing the text "Error creating the control." This usually means that the control's ASP.net syntax is incorrect-for example, if the runat= "server" attribute is missing from a Web server control element, this error is displayed. Point to the information icon (), and a tooltip appears that contains detailed information about the error.