I've a asp.net linkbutton inside asp.net repeater control which renders multiple link buttons. I want to set the style of each and every linkbutton dynamically.
I'm trying
style="color:#6D7B8D;font-size:<%# DataBinder.Eval(Container.DataItem, "Title")%>;"
But i'm getting "The server tag is not well formed" error.
Any ideas?
We can also use trenary operator within it-- to custom the font size
My understanding is that using server tags for attributes requires that the server tag be used for the entire attribute value. Try changing it to this:
Notice how the entire style attribute is being constructed in C# code between the server tags.
Write it like that:
With single quotes instead of double quotes around the style
Remove
To: