Hi,
I want to format an ItemTemplate conditionally but can't find a way to get archieve this.
I've read the Conditional Formatting for rows/cells on ItemDataBound topic but can't apply it to an ItemTemplate.
For example my aspx code:
All what I want to do is, give the "subject" an individul style, depending on the value of "read" which is stored in the same table (not visible to users here) and could be empty or a string.
If I use a simple if statement checking the value using Eval("read") inside the ItemTemplate it trhows a TargetInvocationException.
Any help would be appreciated.
Regards
I want to format an ItemTemplate conditionally but can't find a way to get archieve this.
I've read the Conditional Formatting for rows/cells on ItemDataBound topic but can't apply it to an ItemTemplate.
For example my aspx code:
| <ItemTemplate> |
| <span style="display: block; float: left;"> |
| <%# Eval (Session["ntyp"].ToString())%> |
| </span> <span style="display: block; float: right;"> |
| <%# Eval("date")%> |
| </span> |
| <br /> |
| <span> |
| <%# Eval("subject")%> |
| </span> |
| </ItemTemplate> |
All what I want to do is, give the "subject" an individul style, depending on the value of "read" which is stored in the same table (not visible to users here) and could be empty or a string.
If I use a simple if statement checking the value using Eval("read") inside the ItemTemplate it trhows a TargetInvocationException.
Any help would be appreciated.
Regards