我是这样绑定的数据 请教我该怎么分页
<scripttype="text/javascript">jQuery(document).ready(function(){jQuery.getJSON("Handl...
<script type="text/javascript">
jQuery(document).ready(function () {
jQuery.getJSON("Handler3.ashx", function (data) {
var innerHtml = "";
jQuery.each(data, function (i, fatherItem) {
innerHtml = innerHtml + "<tr>";
var strTds = "<td width='80' >" + fatherItem.Id + "</td>"
+ "<td width='120'>" + fatherItem.Name + "</td>"
+ "<td width='80'>" + fatherItem.Age + "</td>"
+ "<td width='80'>" + fatherItem.Address + "</td>"
+ "<td width='200'>" + fatherItem.Phone + "</td>"
+ "<td width='60'>" + fatherItem.Sex + "</td>"
innerHtml = innerHtml + strTds;
innerHtml = innerHtml + "</tr>";
});
jQuery(".content").html(innerHtml);
}
, "json");
});
</script>
<body>
<div style="padding:3px;line-height:26px;">
<form >
<span style="margin-left:150px;">Age:</span>
<input id="txtage" style="line-height:25px;border:1px solid #ccc" type="text" />
<span>Sex:</span>
<input id="txtsex" style="line-height:25px;border:1px solid #ccc" type="text" />
<a href="#" class="searchbox-button" style="width:40px; height:20px; line-height:25px;" <%--class="easyui-linkbutton"--%> onclick="doSearch()">Search</a>
</form>
</div>
<div style="width:755px;" >
<table>
<tr >
<th style="width:80px;" >Id</th>
<th style="width:120px;">Name</th>
<th style="width:80px;" >Age</th>
<th style="width:80px;" >Address</th>
<th style="width:200px;">Phone</th>
<th style="width:60px;">Sex</th>
</tr>
</table>
</div>
<div style="width:755px;" id="div3">
<table style="text-align:center;" class="content" >
</table>
</div>
</body>
</html> 展开
jQuery(document).ready(function () {
jQuery.getJSON("Handler3.ashx", function (data) {
var innerHtml = "";
jQuery.each(data, function (i, fatherItem) {
innerHtml = innerHtml + "<tr>";
var strTds = "<td width='80' >" + fatherItem.Id + "</td>"
+ "<td width='120'>" + fatherItem.Name + "</td>"
+ "<td width='80'>" + fatherItem.Age + "</td>"
+ "<td width='80'>" + fatherItem.Address + "</td>"
+ "<td width='200'>" + fatherItem.Phone + "</td>"
+ "<td width='60'>" + fatherItem.Sex + "</td>"
innerHtml = innerHtml + strTds;
innerHtml = innerHtml + "</tr>";
});
jQuery(".content").html(innerHtml);
}
, "json");
});
</script>
<body>
<div style="padding:3px;line-height:26px;">
<form >
<span style="margin-left:150px;">Age:</span>
<input id="txtage" style="line-height:25px;border:1px solid #ccc" type="text" />
<span>Sex:</span>
<input id="txtsex" style="line-height:25px;border:1px solid #ccc" type="text" />
<a href="#" class="searchbox-button" style="width:40px; height:20px; line-height:25px;" <%--class="easyui-linkbutton"--%> onclick="doSearch()">Search</a>
</form>
</div>
<div style="width:755px;" >
<table>
<tr >
<th style="width:80px;" >Id</th>
<th style="width:120px;">Name</th>
<th style="width:80px;" >Age</th>
<th style="width:80px;" >Address</th>
<th style="width:200px;">Phone</th>
<th style="width:60px;">Sex</th>
</tr>
</table>
</div>
<div style="width:755px;" id="div3">
<table style="text-align:center;" class="content" >
</table>
</div>
</body>
</html> 展开
2014-06-03
展开全部
用SQL语句控制分页,翻页之后重新绑定数据
追问
代码怎么写 求教谢谢
追答
declare @pageSize int,
@pageIndex int
set @pageSize=3
set @pageIndex=2
select top (@pageSize) * from minzu where id not in
(select top (@pageSize*(@pageIndex-1)) id from minzu)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询