This should be really easy but I can’t figure out how to make it work…
I have an ASP.NET UserControl (.ascx) with the following property:
public string LabelCssClass
{
get
{
return _labelCssClass;
}
set
{
_labelCssClass = value;
}
}
I want to bind that property into the HTML of the UserControl at run time, using the <%# syntax. I imagine it must be something along these lines:
<td class="<%# Eval("LabelCssClass") %>" >
I’ve tried all different versions of Eval() and so on … I’m not getting errors but the binding isn’t working, and my breakpoints show that the property is not being accessed.
Whats the correct syntax? cheers
I think what you might want is this: