HI,
Ive got the following easy question.
I had a for loop, however when i set it in a foreach loop it doesn;t know "[I] . How can i fix this???
for lop:
@for (int i = 0; i < 2; i++)
{
@Html.Partial("_CollectorStatusOne", Model.CollectorStatus.FirstOrDefault(cs => cs.CollectorID == Model.Collectors.ToList()[i].CollectorID))
}
{
@Html.Partial("_CollectorStatusOne", Model.CollectorStatus.FirstOrDefault(cs => cs.CollectorID == Model.Collectors.ToList()[i].CollectorID))
}
foreach loop:
@foreach (var item in Model.Collectors)
{
@Html.Partial("_CollectorStatusOne", Model.CollectorStatus.FirstOrDefault(cs => cs.CollectorID == Model.Collectors.ToList()[i].CollectorID))
}
{
@Html.Partial("_CollectorStatusOne", Model.CollectorStatus.FirstOrDefault(cs => cs.CollectorID == Model.Collectors.ToList()[i].CollectorID))
}
Shubham KumarPosted Feb 4, 2016, 5:15 AM
Cassie ModPosted Feb 4, 2016, 5:13 AM
Shubham KumarPosted Feb 4, 2016, 5:04 AM
{
@Html.Partial("_CollectorStatusOne", Model.CollectorStatus.FirstOrDefault(cs => cs.CollectorID == Item.CollectorID))
}
Cassie ModPosted Feb 4, 2016, 4:56 AM
Shubham KumarPosted Feb 4, 2016, 4:48 AM
Cassie ModPosted Feb 4, 2016, 4:24 AM
Shubham KumarPosted Feb 4, 2016, 4:05 AM
{
@Html.Partial("_CollectorStatusOne", Model.CollectorStatus.FirstOrDefault(cs => cs.CollectorID == Model.Collectors.ToList()[i].CollectorID))
{
@Html.Partial("_CollectorStatusOne", Model.CollectorStatus.FirstOrDefault(cs => cs.CollectorID == Model.Collectors.ToList()[i].CollectorID))
}