【发布时间】:2012-12-13 13:51:19
【问题描述】:
这是情况:
if count items is either 0,1,5,7,8,9,10 then string = "string one"
if count items is either 2,3,4 then string = "string two"
我尝试过(在 cs razor 视图内)
@if (@item.TotalImages == 1 || 5 || 7 || 8 || 9 || 10)
{
string mystring = "string one"
}
但我收到此错误
运算符 ||不能应用于 bool 或 int 类型的操作数
【问题讨论】:
标签: c#