asp.net - How to determine css's class with if statement -
<div class="<%#((int)eval("cevaplanma_sayisi")>0) ? "divcevaplanmasayisiozel" : "divcevaplanmasayisinormal" %>">
my code above.the code runs when use access database doesnt run sqlserver2008 error.it says when runs code invalid exception handled
try this:
<div class='<%#(((int)eval("cevaplanma_sayisi"))>0) ? "divcevaplanmasayisiozel" : "divcevaplanmasayisinormal" %>'>
the first problem need convert object
value of "cevaplanma_sayisi" int
.
the second problem must wrap eval
statement within '
, '
, otherwise malformed html.
Comments
Post a Comment