%@ Control Language="C#" AutoEventWireup="true" Inherits="AVA.ResourcesPlatform.WebUI.Control.Pagination" %>
<%
if (this.Query.PageIndex <= 1)
{
%>
-
<%= new HtmlAnchor("首页") { Href = "#" }%>
<%
}
else
{
%>
-
<%= new HtmlAnchor("首页") { Href = this.GetPageUrl(1) }%>
<%
}
%>
<%
if (this.Query.PageIndex - 1 < 1)
{
%>
-
<%= new HtmlAnchor("上页") { Href = "#" }%>
<%
}
else
{
%>
-
<%= new HtmlAnchor("上页") { Href = this.GetPageUrl(this.Query.PageIndex - 1) }%>
<%
}
%>
<%
int beginPageItem = (this.Query.PageIndex % 8 == 0 ? this.Query.PageIndex - 1 : this.Query.PageIndex) / 8 * 8 + 1;
int endPageItem = beginPageItem + 8 - 1;
if (endPageItem > this.Query.PageCount)
{
endPageItem = this.Query.PageCount;
}
if (beginPageItem > 1)
{
//如果不是第一个页数的话
%>
-
<%= new HtmlAnchor("...") { Href = this.GetPageUrl(beginPageItem - 1) }%>
<%
}
for (int i = beginPageItem; i <= endPageItem; i++)
{
if (i == this.Query.PageIndex)
{
%>
-
<%= new HtmlAnchor(i.ToString()) { Href = "#" }%>
<%
}
else
{
%>
-
<%= new HtmlAnchor(i.ToString()) { Href = this.GetPageUrl(i) }%>
<%
}
}
if (endPageItem < this.Query.PageCount)
{
//如果不是第一个页数的话
%>
-
<%= new HtmlAnchor("...") { Href = this.GetPageUrl(endPageItem + 1) }%>
<%
}
%>
<%
if (this.Query.PageIndex + 1 > this.Query.PageCount)
{
%>
-
<%= new HtmlAnchor("下页") { Href = "#" }%>
<%
}
else
{
%>
-
<%= new HtmlAnchor("下页") { Href = this.GetPageUrl(this.Query.PageIndex + 1) }%>
<%
}
%>
<%
if (this.Query.PageIndex == this.Query.PageCount)
{
%>
-
<%= new HtmlAnchor("末页") { Href = "#" }%>
<%
}
else
{
%>
-
<%= new HtmlAnchor("末页") { Href = this.GetPageUrl(this.Query.PageCount) }%>
<%
}
%>