@foreach (var articleOnFirstPage in Model.ArticlesOnFirstSite)
{
<td>
if (@article.Deleted == true)
{
@:Yes
}
else
{
@:No
}
</td>
}
can i do this like @article.Deleted == true ? @:Yes : @:No
@article.Deleted == true ? @:Yes : @:No
?
i try but i get error. Is there any good web page with this examples for mvc3 razor?
做就是了:
@(article.Deleted ? "Yes" : "No")
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.