Hi,
In my view code I have written code for editing a record
@Html.ActionLink("Details", "Details", new { id = item.Tracking })
When loading the data I am able to see the fields mentioned in the script,
But In controller code
public ActionResult Edit(int SlNo)
{
var viewModel = new POViewModel();
viewModel.Order = PODb.orders.Single(x => x.Sl_No == SlNo);
viewModel.Order = (order)PODb.orders.Where(x => x.Sl_No == SlNo);
return View(viewModel);
}
Here In the above code I am getting the parameter value as null as it is throwing the below exception
"The parameters dictionary contains a null entry for parameter 'SlNo' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult Edit(Int32)' in 'PurchaseOrder.Controllers.POController'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter.
The parameters dictionary contains a null entry for parameter 'SlNo' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult Edit(Int32)' in 'PurchaseOrder.Controllers.POController'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter.
Parameter name: parameters"
Could any one please help me how to rectify this one?

Fabio Silva LimaRank #750 · 3.1K reputationPosted Dec 15, 2016, 6:54 AM EST
Dilip GuptaRank #2,085 · 690 reputationPosted Dec 15, 2016, 6:28 PM EST
Mahesh Bodepudi91 reputationPosted Dec 15, 2016, 6:36 PM EST
Rajeesh MenothRank #118 · 18.4K reputationPosted Dec 15, 2016, 6:50 PM EST
Dilip GuptaRank #2,085 · 690 reputationPosted Dec 22, 2016, 8:01 PM EST
MayankRank #4,018 · 371 reputationPosted Dec 26, 2016, 2:32 AM EST