My question is the following, in my project of ASP.NET
, I have in a view, the foreach
of razor with which I print my values of the model, and a div is created for each iteration, what I need is that this div
have an id autoincrementable
, due to the logic of some functions of JS that I have.
How can I achieve this?
Since if I assign a variable automatically it transforms the character into a string
and does not take the numerical value.
@model IEnumerable<MvcFrontBolsaTrabajo.Models.ParaProcReportes.PostulacionesXCandidatoModel>
@using Newtonsoft.Json;
@{
Layout = "~/Views/Shared/_LayoutCandidato.cshtml";
}
@{
ViewBag.Title = "PostulacionesXCandidato";
}
<div id="divP">
@foreach (var item in Model)
{
<div class="panel panel-primary " id="" style="display:inline-block; text-align:center; width: 16%; margin: 5%;">
<div class="panel-heading">
@Html.DisplayFor(modelItem => item.TituloVacante)
</div>
<p>
@Html.DisplayFor(modelItem => item.Nombresoc)
</p>
<p>
@Html.DisplayFor(modelItem => item.Nombreciu)
</p>
<p>
@Html.DisplayFor(modelItem => item.FechaPostulacionvc)
</p>
<div>
</div>
</div>
}
</div>