<td nowrap valign="top">
<input class="formsubmit" id="btnGo" type="button" value="Show Description"
style = "<%# If (DataBinder.Eval(Container, "DataItem.Exclamation").ToString() == "1")
then Response.Write("color:red")
Else Response.Write("color:black") EndIf%>"
OnClick="btnShowDescription('<%#DataBinder.Eval(Container, "DataItem.ListingDescription")%>');" />
</td>
`
This is the code for a cell on my table. I’m trying to get it to work but there’s a compiler issue saying that I’m missing a closed parentheses which I’m not. (hopefully). Can anyone see what the error could be? I thought I did the if/else logic right. Basically I’m trying to set the font color of a button based on what the value of a certain item in a database.
I think it is because the
style=" "is choking on the first double quote?Perhaps you need to escape one or more of the quotes?