I want to use @Html.DisplayFor
instead of @Html.TextBoxFor
in my application.
If I use @Html.TextBoxFor
then I can pass values to controller but if I use @Html.DisplayFor
then it is passing null everytime.
Please suggest me how to use the same data which I am passing in Textbox should pass into DisplayFor.
@for (int counter = 0; counter <= Model.Employees.Count - 1; counter++)
{
<tr>
<td>
@Html.TextBoxFor(m => m.Employees[counter].Name, null, new { @class = "form-control" }) do not want to use
@Html.DisplayFor(m => m.Employees[counter].Name, null, new { @class = "form-control" }) ///want to use
</td>
}