<ItemTemplate>
<tr>
<td>
<asp:CheckBox runat="server" Text="<%#Container.DataItem('Text')%>" />
</td>
</tr>
</ItemTemplate>
How do I get Text to be set from the bound field (which is also called Text)? I tried many ways like Val(“”) but it always says an error.
For the example above it says : Compiler Error Message: CS1012: Too many characters in character literal.
If I change it to <asp:CheckBox runat="server" Text="<%#Container.DataItem("Text")%>" /> — it says : Parser Error Message: The server tag is not well formed.
1 Answer