@using System.Collections.Specialized;
@functions{
//默认分页函数
private string Pagebreak(int page, string urlPrefix, string urlParams = "")
{
string rv = "";
if (page > 1)
{
rv = urlPrefix + page + "/";
}
else
{
rv = urlPrefix;
}
rv += urlParams;
return rv;
}
private string GetUrlParams()
{
string rv = "";
NameValueCollection queryStrings = Request.QueryString;
int count = queryStrings.Count;
if (count > 0)
{
rv = "?";
}
foreach (string key in queryStrings)
{
if (rv.IndexOf("=") > 0)
{
rv += "&";
}
rv += key + "=" + HttpUtility.UrlEncode(queryStrings[key]);
}
return rv;
}
}
@{
PageInfo pageInfo = (PageInfo)Model;
int pageCount = pageInfo.PageCount;
int pageSize = pageInfo.PageSize;
int recordCount = pageInfo.RecordCount;
int currentPage = pageInfo.CurrentPage;
int m = 2; //左右两边显示页码数
string urlParams = GetUrlParams();
string urlPrefix;
if (ViewData.ContainsKey("path"))
{
urlPrefix = (string)ViewData["path"];
}
else