I have 2 entities Orders and Items with OrdersController and ItemsController. In my Orders Index View I have a webgrid
grid.Column(columnName: "OrderNo", header: "Order No.", canSort: true),
grid.Column(columnName: "OrderDate", header: "Order Date", canSort: true),
grid.Column(" ", " ", format: @<a href="@Url.Action("Index", "Items", new { id = item.OrderNo })">Items</a>)
议程项目 主计长 我在指数中增加了一个参数:
public ActionResult Index(string id = "0")
{
var orderq = from a in db.items
where a.OrderNo== id
select a;
return View(orderq.ToList()); // ex : orderq.Count = 2
}...
protected override void Dispose(bool disposing)
{
db.Dispose();
base.Dispose(disposing);
} // Object reference not set to an instance of an object
但我收到。 反对不针对物体的例子。
Q : 我不得不从我的命令中打开这些物品?
我是否必须澄清我的情况并再次宣布它?