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 run the page, I get the following error: CS1002: ; expected
with the line directly under <ItemTemplate>
highlighted. Why is this? I thought that When you use <%# XXXXX %>
, you don't use a semicolon.
I tried changing this to <%# Eval("FirstName") %>
and that seems to work.
Oops, I just realized that I have an extra ")" which caused the error.
<%# ((MyType)Container.DataItem).FirstName) %>
needs to be_<%# ((MyType)Container.DataItem).FirstName %>