日期:2014-05-17 浏览次数:20512 次
string sql = "select * from (select *,row_number() over (order by id) as r_num from Topic) as rum_table where r_num between (@page-1) * @pagesize+1 and @pagesize * @page"
var currentPage = 1;
var pagesize = 20;
var pageCount;
//下一页
function loadNext() {
currentPage = currentPage + 1;
loadData(currentPage, pagesize);
//alert(currentPage);
}
//上一页
function loadPrev() {
currentPage = currentPage - 1;
loadData(currentPage, pagesize);
//alert(currentPage);
}
//访问指定页
function GoToPage() {
var toPage = $("#ToPage").val();
if (toPage < 1
------解决方案--------------------
toPage > pageCount) {
$.messager.alert("系统提示", "不存在的页码!!", "info");
$("#ToPage").val("");
return false;
}
loadData(toPage, pagesize);
currentPage = parseInt(toPage, 10);
}
//加载数据
function loadData(currentPage, pagesize) {
$.ajax({
url: "loadTable.ashx",
data: { "getType": "1", "currentPage": currentPage, "pagesize":