I need to map based on two keys(comp and part).
@foreach (var item in Model) {
<tr>
<td>
@Html.DisplayFor(modelItem => item.comp)
</td>
<td>
@Html.DisplayFor(modelItem => item.part)
</td>
...........................
<td>
@Html.ActionLink("Edit", "Edit", new { id=item.comp }) |
@Html.ActionLink("Details", "Details", new { id = item.comp }) |
@Html.ActionLink("Delete", "Delete", new { id = item.comp })
</td>
</tr>
}
how to use composite key in Index page and also in controller.
public ActionResult Edit(int? id)
{
DataView record = db.RecordDataView.Find(id);
if (record == null)
{
return HttpNotFound();
}
return View(record);
}
If anyone have idea please reply.