一個(gè)分頁(yè)的ASP代碼實(shí)例
作者: 來(lái)源: 發(fā)布時(shí)間:2011-6-9 11:37:48 點(diǎn)擊:
Response.Write("<option selected>"&i&"</option>") ''當(dāng)前頁(yè)碼
else
Response.Write("<option>"&i&"</option>")
end if
Next
Response.Write("</select>頁(yè)/共"&rs.PageCount&"頁(yè) 共"&rs.RecordCount&"條記錄</font><p>")
Response.Write("</form>")
''創(chuàng)建表格,用于顯示
Response.Write("<table align=center cellspacing=1 cellpadding=1 border=1")
Response.Write(" bordercolor=#99CCFF bordercolordark=#b0e0e6 bordercolorlight=#000066>")
Response.Write("<tr bgcolor=#ccccff bordercolor=#000066>")
Set Columns=rs.Fields
''顯示表頭
For i=0 to Columns.Count-1
Response.Write("<td align=center width=200 height=13>")
Response.Write("<font size=2><b>"&Columns(i).name&"</b></font></td>")
Next
Response.Write("</tr>")
''顯示內(nèi)容
For i=1 to rs.PageSize
Response.Write("<tr bgcolor=#99ccff bordercolor=#000066>")
For j=0 to Columns.Count-1
Response.Write("<td><font size=2>"&Columns(j)&"</font></td>")
Next
Response.Write("</tr>")
rs.movenext
if rs.EOF then exit for
Next
Response.Write("</table>")
END IF
%>
</BODY>
</HTML>
else
Response.Write("<option>"&i&"</option>")
end if
Next
Response.Write("</select>頁(yè)/共"&rs.PageCount&"頁(yè) 共"&rs.RecordCount&"條記錄</font><p>")
Response.Write("</form>")
''創(chuàng)建表格,用于顯示
Response.Write("<table align=center cellspacing=1 cellpadding=1 border=1")
Response.Write(" bordercolor=#99CCFF bordercolordark=#b0e0e6 bordercolorlight=#000066>")
Response.Write("<tr bgcolor=#ccccff bordercolor=#000066>")
Set Columns=rs.Fields
''顯示表頭
For i=0 to Columns.Count-1
Response.Write("<td align=center width=200 height=13>")
Response.Write("<font size=2><b>"&Columns(i).name&"</b></font></td>")
Next
Response.Write("</tr>")
''顯示內(nèi)容
For i=1 to rs.PageSize
Response.Write("<tr bgcolor=#99ccff bordercolor=#000066>")
For j=0 to Columns.Count-1
Response.Write("<td><font size=2>"&Columns(j)&"</font></td>")
Next
Response.Write("</tr>")
rs.movenext
if rs.EOF then exit for
Next
Response.Write("</table>")
END IF
%>
</BODY>
</HTML>
[收藏此文章]