@model MDFtoMVCdelete.Models.DeleteModel <center> <table> @foreach (var item in Model.thistable) { <tr><td>@item.testID</td><td>@item.datetime</td><td>@item.col1</td><td>@item.col2</td><td>@item.col3</td><td><form action="@Url.Action("Delete", new{ testID = item.testID })" method="delete"><input type="submit" value="Delete" /></form></td></tr> } </table> </center>
public ActionResult Delete(int testID) { //code omitted for brevity return View(); }
The parameters dictionary contains a null entry for parameter 'testID' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult Delete(Int32)' in 'MDFtoMVCdelete.Controllers.HomeController'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter. Parameter name: parameters
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)