0
@Html.DisplayFor(modelItem => item.vouchertype == "P" ? "Paid" : "Receipt")
&
@Html.DisplayFor(modelItem => item.dated.ToString("dd-MMM-yy"))
試圖格式化值,但錯誤發生時:ASP.NET Core MVC中的IEnumerable視圖模型中的format值如何?
模板只能與字段訪問,屬性訪問,一維數組索引或單個參數定製索引experssions使用。
感謝knowlegding我關於拉姆達李毅華。這工作:@(item.dated.ToString(「dd-MMM-yy」)) –