创新的福州网站建设,小米路由做网站,腾讯云域名价格,海南广播电视总台我正在尝试查看销售订单中的产品列表。它看起来像这样#xff1a;名称OrderDate OrderTotal Products购买被带来的产品。销售订单连接到SalesorderProduct的桥接表。有什么建议。我知道它想要遍历模型#xff0c;但无法弄明白。Html.DisplayFor(model model.Cus…我正在尝试查看销售订单中的产品列表。它看起来像这样名称OrderDate OrderTotal Products购买被带来的产品。销售订单连接到SalesorderProduct的桥接表。有什么建议。我知道它想要遍历模型但无法弄明白。Html.DisplayFor(model model.Customer.Name)Html.DisplayFor(model model.OrderDate);Html.DisplayFor(model model.OrderTotal);Html.DisplayFor(model model.SalesOrderProducts);答案尝试这样的事情model SalesOrder{ViewBag.Title View;}ViewSalesOrderHtml.DisplayNameFor(model model.Name)Html.DisplayFor(model model.Name)Html.DisplayNameFor(model model.OrderDate)Html.DisplayFor(model model.OrderDate)Html.DisplayNameFor(model model.OrderTotal)Html.DisplayFor(model model.OrderTotal)foreach (Product p in Model.SalesOrderProducts){Html.DisplayNameFor(x x.Name)Html.DisplayFor(x x.Name)}Html.ActionLink(Edit, Edit, new { id Model.SalesOrderId }) |Html.ActionLink(Back to List, Index)