1
迭代一個foreach循環,並嘗試用剃刀嵌入一些字符串,以達到此目的我嘗試了下面的代碼;用剃刀條件語句將字符串嵌入到html
<span class="label label-sm [email protected][email protected]("success"):@String.Format("danger"))">
@item.CorrectAnswer
</span>
它在瀏覽器中的樣子;
<span class="label label-sm label-class?success:danger)">
A
</span>
我剛想到;
<span class="label label-sm label-success">
A
</span>
我該怎麼辦?
try @([email protected](「success」):@ String.Format(「danger」)) – Simon