Eval in ItemTemplate

G

Guest

Hi, misters,

I'll try put an attribute runat="server" to TR in ItemTemplate of DAtalist:

....
<ItemTemplate>
<tr id="filaListado<%# Eval("idtareasworkflow") %>"
onclick="SeleccionarFilaLis('<%# Eval("idtareasworkflow") %>', '<%#
Eval("Offset") %>');"
...

but I get error "The server tag is not well formed"

I tried with this post

bruce barker said:
binding expressions (<%# %>) can only be used on controls with
runat=server. also, they must be the complete attribute value
(att="<%#bind_expression%>"). if you need to concat, do it in the
expression.

but I get:

Parser Error Message: The server tag is not well formed.

Line 199: </HeaderTemplate>
Line 200: <ItemTemplate>
Line 201: <tr id="<%=
"filaListado" + Eval("idtareasworkflow") %>"

I've tried too with <%# %>, and <%= %>, but the same error.

Any help, please ? Thanks in advanced.


Any help will be appreciated
 
G

Guest

Hi,
your tag is not well formed because you have too many quotation marks -
always use this syntax: attribute='<%# Eval("...") %>' . As you can see I am
using only one pair of queotation marks and one pair of apostrophes.

Any way your code will not work because you can't bind to ID property.

Regards,
Ladislav
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top