Why C # expects ";" in my ItemTemplates?
I have a page with the following code:
<ItemTemplate>
<a id="el_<%# ((MyType)Container.DataItem).FirstName) %>"
class='activate_edit_modal' popupId="modal_window" title="Click to edit.">
Edit
</a>
</ItemTemplate>
When I try to start the page, I get the following error: CS1002: ; expectedwith a highlighted line under <ItemTemplate>. Why is this? I thought that when you use <%# XXXXX %>, you are not using a semicolon.
I tried changing this to <%# Eval("FirstName") %>and it seems to work.
+3
2 answers