I have a page which represents data from ICollection<>
model, it generates @Html.BeginForm()
for each item in ICollection<>
and shows data with @Html.Labels
, and I want to create a link from each form to item details, so it will be like, when I press form with item with id=4, it sends Model.ElementAt(4)
as a model to new page, and display it. How can I do that?
EDIT: I guess I need to add something like @Html.ActionLink("DetailsPage","Shops",shop)
@using WebShops
@model ICollection<WebShops.Shop>
@foreach (Shop shop in Model)
{
using (Html.BeginForm())
{
@Html.Label(shop.name)
@Html.Display(shop.name)
<br />
@Html.Label(shop.image)
@Html.Display(shop.image)
<hr />
}
}