js 分页怎么弄 这是我的代码 怎么分页 求。。。
<%@PageLanguage="C#"AutoEventWireup="true"CodeFile="Default11.aspx.cs"Inherits="Defau...
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default11.aspx.cs" Inherits="Default11" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<link rel="stylesheet" href="Script1/easyui.css"/>
<link rel="stylesheet" href="Script1/icon.css" />
<script type="text/javascript" src="Script1/jquery-1.8.0.min.js" ></script>
<script type="text/javascript" src="Script1/jquery.easyui.min.js"></script>
<link rel="stylesheet" href="Script1/demo.css" />
<script type="text/javascript">
jQuery(doSearch());
function doSearch() {
//jQuery.post("Handler2.ashx", {
// age: jQuery("#txtage").val(),
// sex: jQuery("#txtsex").val()
//}, "text");
jQuery.getJSON("Handler2.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("tbody").html(innerHtml);
}
, "json")
}
</script>
</head>
<body>
<%--<form action="Handler2.ashx" method="post">--%>
<div id="tb" style="padding:3px;line-height:26px;">
<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>
</div>
<div style="width:700px;" >
<table id="table1" border="0" style="" >
<thead id="table2">
<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>
</thead>
<tbody style="text-align:center;" id="group_one"></tbody>
</table>
</div>
<%--</form>--%>
</body>
</html> 展开
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<link rel="stylesheet" href="Script1/easyui.css"/>
<link rel="stylesheet" href="Script1/icon.css" />
<script type="text/javascript" src="Script1/jquery-1.8.0.min.js" ></script>
<script type="text/javascript" src="Script1/jquery.easyui.min.js"></script>
<link rel="stylesheet" href="Script1/demo.css" />
<script type="text/javascript">
jQuery(doSearch());
function doSearch() {
//jQuery.post("Handler2.ashx", {
// age: jQuery("#txtage").val(),
// sex: jQuery("#txtsex").val()
//}, "text");
jQuery.getJSON("Handler2.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("tbody").html(innerHtml);
}
, "json")
}
</script>
</head>
<body>
<%--<form action="Handler2.ashx" method="post">--%>
<div id="tb" style="padding:3px;line-height:26px;">
<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>
</div>
<div style="width:700px;" >
<table id="table1" border="0" style="" >
<thead id="table2">
<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>
</thead>
<tbody style="text-align:center;" id="group_one"></tbody>
</table>
</div>
<%--</form>--%>
</body>
</html> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询