Reputation: 9225
I have the following line:
<li><%# Eval("Gender").ToString() %></li>
which displays the gender of a person:
M
OR
F
How can I modify so, if it's M, it will display MALE and if it's F, it will display FEMALE?
Upvotes: 0
Views: 81
Reputation: 460058
You could use the conditional operator
<li><%# (String)Eval("Gender") == "M" ? "MALE" : "FEMALE" %></li>
Upvotes: 5