I have a table in my dbml called Product.
In my Controller I have the following LINQ...
public ActionResult Index(int id)
{
using (orbitDataContext = new OrbitDataContext())
{
var products = (from p in orbitDataContext.Products
where p.EventId == id
select p).ToList();
return View(products);
}
}
In my View I have the following...
@model IList<MVC.Product>
@{
ViewBag.Title = "Products";
}
<h2>Products</h2>
<p>
@Html.ActionLink("Create New", "Create")
</p>
<p>
<input type="submit" value="Delete Selected" />
</p>
@foreach (var item in Model)
{
<ul>
<li>@item.Description | @item.ProductCode | @item.Price</li>
</ul>
}
Please can somebody explain how I can display a check box against each product displayed so a user can check multiple products then click a button which sends the selected products back to my controller in order for me to delete them.