I'm trying to implement this algorithm using Razor
, but, I got this exception
System.IndexOutOfRangeException: Index was outside the bounds of the array.
@{
//....
for (int i = tab[0]; i <= tab[4]; i++)
{
if (i == pagination.numPageCourrante)
{
<li class="active"><a href="#">@i <span class="sr-only">(current)</span></a></li>
}
else
{//from here the exception triggers
<li><a href="/Accueil/Rechercher?rech=micro&type=nomAppMetier&num=@(tab[i])">@i </a></li>
}
}
}
Knowing that the declaration of the table is :
int[] tab = new int[5];
Thanks a lot !