我有一个 ActionResult Details()
// RETREIVE THE INDIVIDUAL DETAILS SHOWS
public ActionResult Details(int id)
{
var item = from s in db.Shows.Where(si => si.ShowId == id) select s;
return View(item);
}
}
更新后的 ul 现在如下:
<div id = "browseShow"> <ul>
@foreach (var item in Model)
{
<li class = "lihead">
@item.Title
</li>
<li class = "lihead">
@item.Director.Name
@Html.ActionLink((string)item.Director.Name, "Index" "Director", new { director = item.Director.Name }, null)
</li>
<li>
<i>@item.Synopsis</i>
</li>
<li class = "lihead">
Price per ticket £
@item.Price
</li>
}
我已经更新了 index 方法来接收一个字符串:
public ActionResult Index(string director)
{
return View();
}