asp linkbutton commandargument value results in "The server tag is not well formed"
Posted on 2007-03-26
I have a repeater control which populates a table with asp:linkbuttons.
The asp:linkbuttons each have a different commandName, obviously, but their commandarguments will all be the same. I want their commandarguments to be populated by a data item from the repeater control called "SERVICE_ID".
The following code causes an error when compiled: "The server tag is not well formed"
<td class="intraContent" align="center" style="border-bottom: 2px solid #D3D3D3"><asp:LinkButton runat="Server" id="linkButton1" CssClass="lnkbutton" CommandName="Collection_All" CommandArgument="<%# eval("Service_ID") %>"><%#databinder.eval(container.dataitem,"Collection_Count") %></asp:LinkButton></td>
However, when I replace the commandargument with just a plain old string hard-coded in like "1234", it compiles without a problem.
So what is wrong with the syntax CommandArgument="<%# Eval("Service_ID") %>" ???