Is there a way to pass entire object from ASP.NET MVC 5 View to a Controller? This is my situation:
Your objects could be so big! Query string's has a limitation on how much data you can pass via those based on the browser. You should consider passing a unique id value (of the record) and using which get the entire record from db in your action method and pass that to the view.
@foreach(var item in SomeCollection)
{
@Html.Action("Update me!", "Update", new { id = item.Id })
}
and in the action method
public ActionResult Update(int id)
{
var item = GetItemFromId(id);
return View(item);
}
Assuming GetItemFromId
method returns the method/view model from the unique id value. Basically you get the entire record using this unique id from your db table/repository.