I need to send to a method in the Controller the values filled in the Payment_Value column as shown below:
HomeWhenclickingthegreenbutton,sendviapost,thevaluesofthelistbelowthatgeneratedthetable:
@foreach(variteminModel.vmListPagamentos){<trclass="odd gradeX">
<td>@Html.DisplayFor(modelItem => item.Matricula)</td>
<td>@Html.DisplayFor(modelItem => item.Nome)</td>
<td>@Html.DisplayFor(modelItem => item.Empresa_DtEntrada)</td>
<td>@Html.DisplayFor(modelItem => item.Empresa_DtSaida)</td>
<td>@Html.TextBoxFor(modelItem => item.Pagamento_Valor)</td>
<td>@Html.TextBoxFor(modelItem => item.DtPagamento)</td>
</tr>
}
The problem is in the concatenation of monetary values. The FormCollection, when passing the information to the controller, separates the values of the attribute "item.PaymentValue" with commas. And the value of the field also has a comma. To make it clearer, look at the image below:
I can not figure out how to get these two string values without using Split (','). But if I use split to break this string in two, it will break by 4. For working with monetary value, I do not want to be doing any gambiarra to stay concatenating those values. Is there another way to do this send values to an action in the controller without being via FormCollection? Why I also tried to send the Model as a parameter and it was not ..