/// <summary>
/// Get pagination navigation
/// </summary>
/// <param name="intPageIndex">Page number</param>
/// <param name="intPageCount">Page count</param>
/// <param name="strUrl">Link</param>
/// <returns>HTML Code</returns>
private string GePageNavgation(int intPageIndex, int intPageCount, string strUrl)
{
StringBuilder sb = new StringBuilder("<div class=\"div_pagenavgation\">");
if (intPageCount > 1)
{
//Page number display
if (intPageIndex == 1)
{
("<span class=\"disabled\"> < Previous page</span>");
}
else if (intPageIndex > 1)
{
("<a href=\"" + strUrl + (intPageIndex - 1).ToString() + "\">< Previous Page</a>");
}
bool Dot1 = false, Dot2 = false;
for (int i = 1; i <= intPageCount; i++)
{
if (i == intPageIndex)
{
("<span class=\"current\">" + () + "</span>");
continue;
}
if (i <= 3)
{
("<a href=\"" + strUrl + () + "\">" + () + "</a>");
continue;
}
if (intPageIndex > 7)
{
if (!Dot1)
{
("<span class=\"dotted\">...</span>");
Dot1 = true;
}
}
if (i == intPageIndex - 3)
{
("<a href=\"" + strUrl + () + "\">" + () + "</a>");
continue;
}
if (i == intPageIndex - 2)
{
("<a href=\"" + strUrl + () + "\">" + () + "</a>");
continue;
}
if (i == intPageIndex - 1)
{
("<a href=\"" + strUrl + () + "\">" + () + "</a>");
continue;
}
if (i == intPageIndex + 1)
{
("<a href=\"" + strUrl + () + "\">" + () + "</a>");
continue;
}
if (i == intPageIndex + 2)
{
("<a href=\"" + strUrl + () + "\">" + () + "</a>");
continue;
}
if (i == intPageIndex + 3)
{
("<a href=\"" + strUrl + () + "\">" + () + "</a>");
continue;
}
if ((intPageCount - intPageIndex) > 6 && i > intPageIndex + 3)
{
if (!Dot2)
{
("<span class=\"dotted\">...</span>");
Dot2 = true;
}
}
if (i > intPageCount - 3)
{
("<a href=\"" + strUrl + () + "\">" + () + "</a>");
continue;
}
}
if (intPageIndex == intPageCount)
{
("<span class=\"disabled\">Next page ></span>");
}
else if (intPageIndex + 1 <= intPageCount)
{
("<a href=\"" + strUrl + (intPageIndex + 1).ToString() + "\">Next Page ></a>");
}
}
("</div>");
return ();
}