0

The following is my view collect.cshtml

@using(Html.Beginform("collect", "collection", FormMethod.Post))
{
  <table>
    <tr>
      <th>parameter</th>
      <th>Minimum</th>
      <th>Maximum</th>
      <th>Current Value</th>
    </tr>
    @foreach(var item in ParameterModel)
    {
      <tr>
        <th>@item.parameter</th>
        <th>@item.Minimum</th>
        <th>@item.Maximum</th>
        <th>@HTML.TextBox("Current_Value")</th>
      </tr>
    }
  </table>
  <div>
    <input type="Submit" name="Save">
  <div>  
}

Following is my Controller code

Public ActionResult collect()
{
    var data =db.Collection.ToList();
    return view(data);
}

[HttpPost]
public ActionResult collect(IEnumerable<Collection> lstcol,decimal Current_Value)
{
    //my saving code will be here 
}

In above method I am getting Current_Value which is getting accurate but not getting list of object its getting null

tereško
  • 58,060
  • 25
  • 98
  • 150
Vijaykumar
  • 127
  • 1
  • 10

0 Answers0