p
ublic ActionResult
Sys(string page)
{
if (page
== null)
{
string
SQL = "select top 15 *
From dingdinfo ORDER BY dingdh desc";
ViewData["ds"] = dr.resultSet(sql, "dingdinfo");
}
if (page != null)
{
int pageSL = Convert.ToInt32(page);
string sql = "select top 15 * f
rom dingdinfo where id not in (select top " + (pageSL - 1) * 15 + " id from dingdinfo order by dingdh desc )ORDER BY dingdh desc";
ViewData["ds"] = dr.resultSet(sql, "dingdinfo");
}
//计算pageCount
string sql1 = "select * from dingdinfo";
int pageCount = dr.resultCount(sql1,"dingdinfo");
int Chu = Convert.ToInt32(pageCount / 15);
int yuS = Convert.ToInt32(pageCount % 15);
if (pageCount > 15)
{
int pageJG = Chu;
if (yuS != 0)
{
pageJG = Chu + 1;
ViewData["jg"] = pageJG;
}
else
{
ViewData["jg"] = pageJG;
}
}
return View();
}
<td>
<% int count =Convert.ToInt32(ViewData["jg"]);
if (count != 0)
{
for (int i = 1; i <=count;
i++)
{ %>
<a
href = "
#" onclick="Page(<%:i%>)"><%:i%></a>
<% }
}%>
</td>