1个回答
展开全部
分页效果一般不用Javascript,比较麻烦的这些代码,一般是用数据库输出多少天数据库来指顶一共有多少页下面是个ASP搜索产品的分页代码,里面有HTML标签注意看
<table width="774" border="1" align="center" cellpadding="0" cellspacing="1" bordercolor="#ADADAD" bgcolor="#EFFFFF">
<tr>
<td width="313" align="center" valign="bottom"></td>
<td width="301" valign="bottom">
<label></label>
<label></label>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#EFFFFF">
<form id="form2" name="form2" method="get" action="gouchess.asp">
<tr>
<td align="center"><label>
<input name="shangpinname" type="text" id="shangpinname" />
<input name="Submit2" type="submit" onclick="if(shangpinname.value==""){
alert('请输入要搜索的名称!')
shangpinname.focus()
return false}" value="搜索" />
</label></td>
</tr></form>
</table>
</td>
<td width="149" align="center"><img src="2.jpg" width="72" height="25" /></td>
</tr>
</table>
<table width="774" border="1" align="center" cellpadding="0" cellspacing="1" bordercolor="#ADADAD">
<tr>
<td width="100" align="center" valign="top" bgcolor="#EFFFFF"><img src="bb.gif" width="80" height="120" /></td>
<td width="562" align="center" valign="top"><table width="147" height="288" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><table width="200" border="0" cellpadding="0" cellspacing="0">
<tr>
<%
set rs= Server.CreateObject("adodb.recordset")
sql="select * from shangpin"
rs.open sql,conn,3,2
cols=2
rows=2
i=0
rs.pagesize=cols*rows
page=Request.QueryString("page")
if Trim(Request.QueryString("page"))="" then
page=1
end if
rs.absolutepage=page
do while not rs.eof and i<rs.pagesize
i=i+1
shangpinid=rs(0)
shangpinpath=rs(1)
shangpinname=rs(2)
shangpinxx=rs(3)
shangpinjj=rs(4)
%>
<td><table width="200" height="288" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="195" height="181" align="center"><a href="gouwuchego.asp?shangpinid=<%=shangpinid%>&shangpinpath=<%=shangpinpath%>&shangpinname=<%=shangpinname%>&shangpinxx=<%=shangpinxx%>&shangpinjj=<%=shangpinjj%>"><img src="<%=shangpinpath%>" alt="" width="120" height="120" border="0" /></a></td>
</tr>
<tr>
<td align="center"><%= shangpinjj %></td>
</tr>
<tr>
<td align="center"><%= shangpinname %></td>
</tr>
<tr>
<td align="center"><%= shangpinxx %></td>
</tr>
<tr>
<td height="26" align="center"><a href="gouwuchego.asp?shangpinid=<%=shangpinid%>&shangpinpath=<%=shangpinpath%>&shangpinname=<%=shangpinname%>&shangpinxx=<%=shangpinxx%>&shangpinjj=<%=shangpinjj%>"><img src="gwc.gif" width="100" height="26" border="0" /></a></td>
</tr>
</table></td>
<%
if cint(i/cols)=i/cols then Response.Write("</tr><tr>")
rs.movenext
loop
%>
</tr>
</table></td>
</tr>
</table></td>
<td width="100" align="center" valign="top" bgcolor="#EFFFFF"><img src="bb.gif" width="80" height="120" /></td>
</tr>
</table>
<table width="774" height="30" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#ADADAD" bgcolor="#EFFFFF">
<tr>
<td>
<% for j=1 to rs.pagecount %>
<a href="gouwuche.asp?page=<%=j%>" class="fen"><%= j %></a>
<% next %></td>
</tr>
</table>
<table width="774" border="1" align="center" cellpadding="0" cellspacing="1" bordercolor="#ADADAD" bgcolor="#EFFFFF">
<tr>
<td width="313" align="center" valign="bottom"></td>
<td width="301" valign="bottom">
<label></label>
<label></label>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#EFFFFF">
<form id="form2" name="form2" method="get" action="gouchess.asp">
<tr>
<td align="center"><label>
<input name="shangpinname" type="text" id="shangpinname" />
<input name="Submit2" type="submit" onclick="if(shangpinname.value==""){
alert('请输入要搜索的名称!')
shangpinname.focus()
return false}" value="搜索" />
</label></td>
</tr></form>
</table>
</td>
<td width="149" align="center"><img src="2.jpg" width="72" height="25" /></td>
</tr>
</table>
<table width="774" border="1" align="center" cellpadding="0" cellspacing="1" bordercolor="#ADADAD">
<tr>
<td width="100" align="center" valign="top" bgcolor="#EFFFFF"><img src="bb.gif" width="80" height="120" /></td>
<td width="562" align="center" valign="top"><table width="147" height="288" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><table width="200" border="0" cellpadding="0" cellspacing="0">
<tr>
<%
set rs= Server.CreateObject("adodb.recordset")
sql="select * from shangpin"
rs.open sql,conn,3,2
cols=2
rows=2
i=0
rs.pagesize=cols*rows
page=Request.QueryString("page")
if Trim(Request.QueryString("page"))="" then
page=1
end if
rs.absolutepage=page
do while not rs.eof and i<rs.pagesize
i=i+1
shangpinid=rs(0)
shangpinpath=rs(1)
shangpinname=rs(2)
shangpinxx=rs(3)
shangpinjj=rs(4)
%>
<td><table width="200" height="288" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="195" height="181" align="center"><a href="gouwuchego.asp?shangpinid=<%=shangpinid%>&shangpinpath=<%=shangpinpath%>&shangpinname=<%=shangpinname%>&shangpinxx=<%=shangpinxx%>&shangpinjj=<%=shangpinjj%>"><img src="<%=shangpinpath%>" alt="" width="120" height="120" border="0" /></a></td>
</tr>
<tr>
<td align="center"><%= shangpinjj %></td>
</tr>
<tr>
<td align="center"><%= shangpinname %></td>
</tr>
<tr>
<td align="center"><%= shangpinxx %></td>
</tr>
<tr>
<td height="26" align="center"><a href="gouwuchego.asp?shangpinid=<%=shangpinid%>&shangpinpath=<%=shangpinpath%>&shangpinname=<%=shangpinname%>&shangpinxx=<%=shangpinxx%>&shangpinjj=<%=shangpinjj%>"><img src="gwc.gif" width="100" height="26" border="0" /></a></td>
</tr>
</table></td>
<%
if cint(i/cols)=i/cols then Response.Write("</tr><tr>")
rs.movenext
loop
%>
</tr>
</table></td>
</tr>
</table></td>
<td width="100" align="center" valign="top" bgcolor="#EFFFFF"><img src="bb.gif" width="80" height="120" /></td>
</tr>
</table>
<table width="774" height="30" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#ADADAD" bgcolor="#EFFFFF">
<tr>
<td>
<% for j=1 to rs.pagecount %>
<a href="gouwuche.asp?page=<%=j%>" class="fen"><%= j %></a>
<% next %></td>
</tr>
</table>
AiPPT
2024-09-19 广告
2024-09-19 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询