15 Ağustos 2018 Çarşamba

Foreach içerisindeki modeli post etme

for (var i = 0; i < Model.ToList< RequestCredit>().Count; i++)
{
@Html.HiddenFor(m => Model.ToList< RequestCredit>()[i].Id)


<div class="row" style="margin-bottom: 8px;">
<div class="col-sm-3" style="padding-top:7px;">
<h4 style="margin:0;">
@Html.DisplayFor(m => Model.ToList< RequestCredit>()[i].RequestPriceRangeText)
</h4>
</div>
<div class="col-sm-9">
@Html.TextBoxFor(m => Model.ToList< RequestCredit>()[i].RequestCreditAmount ,
new {@class="form-control", type = "number" })
</div>
</div>



Foreach içerisinde iterasyona tutulan Ienumerable listesi post edilirken sorun yaşandığında bu yöntem kullanılabilir.



Hiç yorum yok:

Yorum Gönder

evren pehlivan yazılım

evren pehlivan yazılım, evren pehlivan yazılım geliştirici