为什么使用Viewbag渲染数据会导致错误?

时间:2018-09-11 16:15:20

标签: c# asp.net-mvc razor

.net mvc剃刀视图为什么会发生此错误

enter image description here

控制器代码

ViewBag.LowStock = db.StockInformations.Where(x => x.Qty <= x.MinStockLevel);

查看代码

  @{
List<StockInformation> DangerLavel = (List<StockInformation>)ViewBag.LowStock;
var count = 0;
ViewBag.Title = "Create";
}

0 个答案:

没有答案