那就正常的分页,第页显示15,只是横着显示罢了.<script language="javascript">function goPage( p_PageNum )
{
document.all['pageNum'].value = p_PageNum;
form1.submit();
}</script><form action="" method="post" name="form1" >
<br>
<!---------分頁開始---------->
<table width="90%" border="0" align="center" cellpadding="4" cellspacing="0" bgcolor="#F1F1F1">
<%
Dim pageRs,pageSQL
Set pageRs = recordset()
pageSQL = "select * from [sp]"
pageRs.Open pageSQL,db,1
If pageRs.RecordCount > 0 Then Dim pageNum
pageNum = Request.Form("pageNum")
If pageNum ="" Then
pageNum = 1
Else
pageNum = Cint( pageNum )
End If
pageRs.PageSize = 15
pageRs.AbsolutePage = pageNum
Dim i,j
i = pageRs.PageSize
While Not pageRs.Eof And i > 0
%>
<!-------------------------此處分類內容開始------------------------->
<tr>
<%
For j = 0 To 2
%>
<td align="center" bgcolor="#FFFFFF">
<table width="110" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="120" align="center">
<a href="pro_intro.asp?id=<%=pageRs("id")%>" target="_blank">
<img src="<%=pageRs("picturePath")%>" width="100" height="100"
onload="resizeImage(this,100,100)" border="0"> </a> </td>
</tr>
<tr>
<td align="center">
<a href="pro_intro.asp?id=<%=pageRs("id")%>" target="_blank">
<%=pageRs("xinhao")%>
</a>
</td>
</tr>
</table>
</td>
<%
pageRs.MoveNext()
i = i -1
If pageRs.Eof Or i <=0 Then
Dim k
For k = 0 To 1-j
out("<td bgcolor=#ffffff></td>")
Next
Exit For
End If
Next
%>
</tr>
<!-------------------------此處分類內容結束------------------------->
<%
'pageRs.MoveNext()
'i=i-1
Wend
End If
%>
</table>
<!----------------------------頁腳說明開始--------------------------->
<%
If pageRs.RecordCount > 0 Then
%>
<table width="90%" border="0" align="center" cellpadding="2" cellspacing="0" bgcolor="#F1F1F1">
<tr>
<td height="15" align="right" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td height="15" align="left" bgcolor="#FFFFFF">
<%=showTextArea(memo2)%>
</td>
</tr>
<tr>
<td height="15" align="right" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td height="15" align="center" bgcolor="#FFFFFF">
<%
Dim strSpace
strSpace = " "
Response.Write "共 "&pageRs.RecordCount&" 條記錄"&strSpace
Response.Write "共 "&pageRs.PageCount&" 頁"&strSpace
If pageNum = 1 Then
Response.Write("上一頁"&strSpace)
Else
Response.Write( "<a href='javascript:goPage("&pageNum-1&");'>上一頁</a>" &strSpace )
End If
If pageNum = pageRs.PageCount Then
Response.Write("下一頁"&strSpace)
Else
Response.Write( "<a href='javascript:goPage("&pageNum+1&");'>下一頁</a>" &strSpace )
End If
%>
第
<select class="input1111" onChange="goPage(this.value)">
<%
for i=1 to pageRs.PageCount
if i = pageNum then
Response.Write "<option value="&i&" selected>"&i&"</option>"
else
Response.Write "<option value="&i&">"&i&"</option>"
end if
next
%>
</select>頁
<input type="hidden" name="pageNum" >
<input type="hidden" name="reqType">
<input type="hidden" name="id">
</td>
</tr>
</table>
<!----------------------------頁腳說明結束--------------------------->
<%
Else
%>
<table width="90%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#F1F1F1">
<tr>
<td align="center" bgcolor="#FFFFFF">
<font color="red">沒有相關記錄</font>
</td>
</tr>
</table>
<%
End If
%>
<!---------分頁結束---------->
</form>
{
document.all['pageNum'].value = p_PageNum;
form1.submit();
}</script><form action="" method="post" name="form1" >
<br>
<!---------分頁開始---------->
<table width="90%" border="0" align="center" cellpadding="4" cellspacing="0" bgcolor="#F1F1F1">
<%
Dim pageRs,pageSQL
Set pageRs = recordset()
pageSQL = "select * from [sp]"
pageRs.Open pageSQL,db,1
If pageRs.RecordCount > 0 Then Dim pageNum
pageNum = Request.Form("pageNum")
If pageNum ="" Then
pageNum = 1
Else
pageNum = Cint( pageNum )
End If
pageRs.PageSize = 15
pageRs.AbsolutePage = pageNum
Dim i,j
i = pageRs.PageSize
While Not pageRs.Eof And i > 0
%>
<!-------------------------此處分類內容開始------------------------->
<tr>
<%
For j = 0 To 2
%>
<td align="center" bgcolor="#FFFFFF">
<table width="110" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="120" align="center">
<a href="pro_intro.asp?id=<%=pageRs("id")%>" target="_blank">
<img src="<%=pageRs("picturePath")%>" width="100" height="100"
onload="resizeImage(this,100,100)" border="0"> </a> </td>
</tr>
<tr>
<td align="center">
<a href="pro_intro.asp?id=<%=pageRs("id")%>" target="_blank">
<%=pageRs("xinhao")%>
</a>
</td>
</tr>
</table>
</td>
<%
pageRs.MoveNext()
i = i -1
If pageRs.Eof Or i <=0 Then
Dim k
For k = 0 To 1-j
out("<td bgcolor=#ffffff></td>")
Next
Exit For
End If
Next
%>
</tr>
<!-------------------------此處分類內容結束------------------------->
<%
'pageRs.MoveNext()
'i=i-1
Wend
End If
%>
</table>
<!----------------------------頁腳說明開始--------------------------->
<%
If pageRs.RecordCount > 0 Then
%>
<table width="90%" border="0" align="center" cellpadding="2" cellspacing="0" bgcolor="#F1F1F1">
<tr>
<td height="15" align="right" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td height="15" align="left" bgcolor="#FFFFFF">
<%=showTextArea(memo2)%>
</td>
</tr>
<tr>
<td height="15" align="right" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td height="15" align="center" bgcolor="#FFFFFF">
<%
Dim strSpace
strSpace = " "
Response.Write "共 "&pageRs.RecordCount&" 條記錄"&strSpace
Response.Write "共 "&pageRs.PageCount&" 頁"&strSpace
If pageNum = 1 Then
Response.Write("上一頁"&strSpace)
Else
Response.Write( "<a href='javascript:goPage("&pageNum-1&");'>上一頁</a>" &strSpace )
End If
If pageNum = pageRs.PageCount Then
Response.Write("下一頁"&strSpace)
Else
Response.Write( "<a href='javascript:goPage("&pageNum+1&");'>下一頁</a>" &strSpace )
End If
%>
第
<select class="input1111" onChange="goPage(this.value)">
<%
for i=1 to pageRs.PageCount
if i = pageNum then
Response.Write "<option value="&i&" selected>"&i&"</option>"
else
Response.Write "<option value="&i&">"&i&"</option>"
end if
next
%>
</select>頁
<input type="hidden" name="pageNum" >
<input type="hidden" name="reqType">
<input type="hidden" name="id">
</td>
</tr>
</table>
<!----------------------------頁腳說明結束--------------------------->
<%
Else
%>
<table width="90%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#F1F1F1">
<tr>
<td align="center" bgcolor="#FFFFFF">
<font color="red">沒有相關記錄</font>
</td>
</tr>
</table>
<%
End If
%>
<!---------分頁結束---------->
</form>
解决方案 »
- js CheckBoxList
- 调试的问题
- 请问在javascript里如何取到GridView你所选择的一行上的某一个字段的值!
- 求素数
- 存储过程参数output问题,好像不能传入数据??
- 关于ASP.NET2.0 BoundField.DataFormatString 属性 高手请进
- 新手提问!
- 急!!!在线等,在DataGrid里面的模板列中动态的加载用户控件(*ascx),在页面加载时用这个relanswer huida=(relanswer)this.Page.Load
- 为什么启动vs.net时老是弹出office安装程序对话框?
- 我已经安装了vs.net,因为工作需要,现在要安装vb6.0,不知道是否可以?
- 救急!!!谁来救救我啊!!!
- sql查询问题
response.write ("[")
response.write "<a href=index.asp?pagenum="&p&">"&p&"</a>"
response.write ("]")
next