1

In MVC3 view i have a table made by RadioButtons populated by entityObject:

@model IEnumerable<Table>  (View is made as "List")

Below i added a postBack "Save" button:

@using (Html.BeginForm("Save", "MyView", FormMethod.Post, new { ent = Model }))
{
    <input type="submit" value="Save" />
}

And in controler i added:

[HttpPost]
public ActionResult Save(List<Table> ent)
{
    // do something
}

But is not right. How to correct the code to return all list in controler side. Thx.

TiviDan
  • 31
  • 4
  • You forgot to add the code that generates the html input fields. The problem is probably in that code. – goenning Feb 13 '12 at 15:35

1 Answers1

1

You need to add the proper code to write the radio buttons in the view, otherwise they will never be submitted in your post request.

By the way, postback is a term used in webforms and not MVC.

The most voted answer for ASP.NET MVC: Is postback still here provides an answer.

Community
  • 1
  • 1
Fabio Milheiro
  • 8,100
  • 17
  • 57
  • 96