
asp代码问题 在线求救
要做1.2.3.4.5.---10然后做四个图片按钮(上一页,下一页,首页,尾页)我自己写了代码老是出错,希望高手们帮帮忙。代码如下<formmethod="post"a...
要做 1 . 2 . 3. 4. 5. ---10 然后做四个图片按钮(上一页,下一页,首页,尾页)我自己写了代码 老是出错,希望高手们帮帮忙。
代码如下
<form method="post" action="../newhouse/introduction.asp">
<%if Page<2 then
response.write "<img src=/faq/photo/ico_5.gif border=0 /> <img src=/faq/photo/ico_2.gif border=0 /> "
else
response.write "<a href=introduction.asp?page=1><img src=/faq/photo/ico_5.gif border=0 /></a> "
response.write "<a href=introduction.asp?page=" & Page-1 & "><img src=/faq/photo/ico_2.gif border=0 /></a> "
end if
if rs.pagecount-page<1 then
response.Write( page &"<span class=STYLE82>|</span>")
else
if rs.pagecount<10 then
for i=1 to rs.pagecount
if page=i then
response.Write( i &"<span class=STYLE82>|</span>")
else
response.Write("<a href=introduction.asp?page=" & i & ">"& i &"</a><span class=STYLE82>|</span>")
end if
next
else
for p=1 to 5
response.Write("<a href=introduction.asp?page=" & page+p-5 & ">"& page+p-5 &"</a><span class=STYLE82>|</span>")
next
response.Write( i &"<span class=STYLE82>|</span>")
for p=1 to 5
response.Write("<a href=introduction.asp?page=" & page+p & ">"& page+p&"</a><span class=STYLE82>|</span>")
next
end if
end if
if rs.pagecount-page<1 then
response.write "<img src=/faq/photo/ico_3.gif border=0 /> <img src=/faq/photo/ico_4.gif />"
else
response.write "<a href=introduction.asp?page=" & (page+1) & ">"
response.write "<img src=/faq/photo/ico_3.gif border=0 /></a> <a href=introduction.asp?page="&rs.pagecount&"><img src=/faq/photo/ico_4.gif border=0 /></a>"
end if
%>
</form></td>
</tr>
</table>
<%end if%>
我的网址是(韩文)http://www.qdbdc.com/introduction.asp 最下面那个 如果解决了可以在给100分 谢谢 展开
代码如下
<form method="post" action="../newhouse/introduction.asp">
<%if Page<2 then
response.write "<img src=/faq/photo/ico_5.gif border=0 /> <img src=/faq/photo/ico_2.gif border=0 /> "
else
response.write "<a href=introduction.asp?page=1><img src=/faq/photo/ico_5.gif border=0 /></a> "
response.write "<a href=introduction.asp?page=" & Page-1 & "><img src=/faq/photo/ico_2.gif border=0 /></a> "
end if
if rs.pagecount-page<1 then
response.Write( page &"<span class=STYLE82>|</span>")
else
if rs.pagecount<10 then
for i=1 to rs.pagecount
if page=i then
response.Write( i &"<span class=STYLE82>|</span>")
else
response.Write("<a href=introduction.asp?page=" & i & ">"& i &"</a><span class=STYLE82>|</span>")
end if
next
else
for p=1 to 5
response.Write("<a href=introduction.asp?page=" & page+p-5 & ">"& page+p-5 &"</a><span class=STYLE82>|</span>")
next
response.Write( i &"<span class=STYLE82>|</span>")
for p=1 to 5
response.Write("<a href=introduction.asp?page=" & page+p & ">"& page+p&"</a><span class=STYLE82>|</span>")
next
end if
end if
if rs.pagecount-page<1 then
response.write "<img src=/faq/photo/ico_3.gif border=0 /> <img src=/faq/photo/ico_4.gif />"
else
response.write "<a href=introduction.asp?page=" & (page+1) & ">"
response.write "<img src=/faq/photo/ico_3.gif border=0 /></a> <a href=introduction.asp?page="&rs.pagecount&"><img src=/faq/photo/ico_4.gif border=0 /></a>"
end if
%>
</form></td>
</tr>
</table>
<%end if%>
我的网址是(韩文)http://www.qdbdc.com/introduction.asp 最下面那个 如果解决了可以在给100分 谢谢 展开
11个回答
展开全部
上面回答的,都没有说到重点,如果楼主想用,我可以帮忙
给你一个肯定可以用的例子:
<!--#include file="conn.asp"-->
<%
set rst=server.createobject("adodb.recordset")
sql="select * from info order by id desc"
rst.open sql,conn,1,1
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>信息管理</title>
<link rel="stylesheet" href="style.css">
<script language="javascript">
function myhomepage(){
this.homepage.style.behavior='url(#default#homepage)';this.homepage.sethomepage('http://www.6882.com';);
}
</script>
<p align="center"><a href="http:netbei.com" name="homepage"
onclick="myhomepage();"></a>
</head>
<body onload="myhomepage();" topmargin="0" background="images/bg.jpg">
<br>
<div align="center">
<center>
<table width="738" height="35" cellspacing="0" cellpadding="0">
<td background="images/top_1.jpg"> <a href="info_manager.asp">信息列表</a>
| <a href="add_info.asp">录入信息</a> | <a href="search_st.asp">查询信息</a></table>
</center>
</div>
<div align="center">
<center>
<table border="0" width="700" cellspacing="0" cellpadding="0">
<%
if Not(rst.bof and rst.eof) then'判别数据表中是否为空记录
NumRecord=rst.recordcount
rst.pagesize=10
NumPage=rst.Pagecount
if request("page")=empty then
NoncePage=1
else
if Cint(request("page"))<1 then
NoncePage=1
else
NoncePage=request("page")
end if
if Cint(Trim(request("page")))>Cint(NumPage) then NoncePage=NumPage
end if
else
NumRecord=0
NumPage=0
NoncePage=0
end if
%>
<table border="1" width="700" bordercolorlight="#000000" cellspacing="0" cellpadding="5" bordercolordark="#FFFFFF">
<tr>
<td width="71" bgcolor="#EBE9FE" align="center">编号</td>
<td width="78" bgcolor="#EBE9FE" align="center">姓名</td>
<td width="65" bgcolor="#EBE9FE" align="center">性别</td>
<td width="89" bgcolor="#EBE9FE" align="center">职业</td>
<td width="110" bgcolor="#EBE9FE" align="center">部门</td>
<td width="110" bgcolor="#EBE9FE" align="center">邮箱</td>
<td width="71" bgcolor="#EBE9FE" align="center">修改</td>
<td width="71" bgcolor="#EBE9FE" align="center">删除</td>
</tr>
<%if Not(rst.bof and rst.eof) then
rst.move (Cint(NoncePage)-1)*10,1
for i=1 to rst.pagesize
%>
<tr>
<td width="77" align="center"><%=rst("bh")%></td>
<td width="100" align="center"><a href=viewuser.asp?id=<%=rst("id")%>><%=rst("xm")%></a></td>
<td width="65" align="center"><%=rst("xb")%></td>
<td width="78" align="center"><%=rst("zy")%></td>
<td width="240" align="center"><%=rst("bm")%></td>
<td width="210" align="center"><%if rst("yx")<>""then %> <%=rst("yx")%> <%else response.write"无" end if%></td>
<td width="71" align="center"><a href=mod_info.asp?id=<%=rst("id")%>>修改</a></td>
<td width="71" align="center"><a href=delete_info.asp?id=<%=rst("id")%>>删除</a></td>
</tr>
<% rst.movenext
if rst.eof then exit for
next
else
response.write "<tr><td colspan=13><marquee scrolldelay=120 behavior=alternate>没有找到任何记录!!!</marquee></td></tr>"
end if
rst.close
set rst=nothing
%>
</table>
</table>
</div>
<table width="748" border="0" align="center">
<tr>
<td height="17">
<div align="right">
<input type="hidden" name="page" value="<%=NoncePage%>">
<%
if NoncePage>1 then
response.write "|<a href=info_manager.asp?page=1>首 页</a>| |<a href=?page="&NoncePage-1&">上一页</a>| "
else
response.write "|首 页| |上一页| "
end if
if Cint(Trim(NoncePage))<Cint(Trim(NumPage)) then
response.write "|<a href=?page="&NoncePage+1&">下一页</a>| |<a href=?page="&NumPage&">尾 页</a>|"
else
response.write "|下一页| |尾 页|"
end if
%>
页次:<font color="#0033CC"><%=NoncePage%></font>/<font color="#0033CC"><%=NumPage%></font>
共<font color="#0033CC"><%=NumRecord%></font>条记录 </div>
</td>
</table>
</center>
</body>
</html>
给你一个肯定可以用的例子:
<!--#include file="conn.asp"-->
<%
set rst=server.createobject("adodb.recordset")
sql="select * from info order by id desc"
rst.open sql,conn,1,1
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>信息管理</title>
<link rel="stylesheet" href="style.css">
<script language="javascript">
function myhomepage(){
this.homepage.style.behavior='url(#default#homepage)';this.homepage.sethomepage('http://www.6882.com';);
}
</script>
<p align="center"><a href="http:netbei.com" name="homepage"
onclick="myhomepage();"></a>
</head>
<body onload="myhomepage();" topmargin="0" background="images/bg.jpg">
<br>
<div align="center">
<center>
<table width="738" height="35" cellspacing="0" cellpadding="0">
<td background="images/top_1.jpg"> <a href="info_manager.asp">信息列表</a>
| <a href="add_info.asp">录入信息</a> | <a href="search_st.asp">查询信息</a></table>
</center>
</div>
<div align="center">
<center>
<table border="0" width="700" cellspacing="0" cellpadding="0">
<%
if Not(rst.bof and rst.eof) then'判别数据表中是否为空记录
NumRecord=rst.recordcount
rst.pagesize=10
NumPage=rst.Pagecount
if request("page")=empty then
NoncePage=1
else
if Cint(request("page"))<1 then
NoncePage=1
else
NoncePage=request("page")
end if
if Cint(Trim(request("page")))>Cint(NumPage) then NoncePage=NumPage
end if
else
NumRecord=0
NumPage=0
NoncePage=0
end if
%>
<table border="1" width="700" bordercolorlight="#000000" cellspacing="0" cellpadding="5" bordercolordark="#FFFFFF">
<tr>
<td width="71" bgcolor="#EBE9FE" align="center">编号</td>
<td width="78" bgcolor="#EBE9FE" align="center">姓名</td>
<td width="65" bgcolor="#EBE9FE" align="center">性别</td>
<td width="89" bgcolor="#EBE9FE" align="center">职业</td>
<td width="110" bgcolor="#EBE9FE" align="center">部门</td>
<td width="110" bgcolor="#EBE9FE" align="center">邮箱</td>
<td width="71" bgcolor="#EBE9FE" align="center">修改</td>
<td width="71" bgcolor="#EBE9FE" align="center">删除</td>
</tr>
<%if Not(rst.bof and rst.eof) then
rst.move (Cint(NoncePage)-1)*10,1
for i=1 to rst.pagesize
%>
<tr>
<td width="77" align="center"><%=rst("bh")%></td>
<td width="100" align="center"><a href=viewuser.asp?id=<%=rst("id")%>><%=rst("xm")%></a></td>
<td width="65" align="center"><%=rst("xb")%></td>
<td width="78" align="center"><%=rst("zy")%></td>
<td width="240" align="center"><%=rst("bm")%></td>
<td width="210" align="center"><%if rst("yx")<>""then %> <%=rst("yx")%> <%else response.write"无" end if%></td>
<td width="71" align="center"><a href=mod_info.asp?id=<%=rst("id")%>>修改</a></td>
<td width="71" align="center"><a href=delete_info.asp?id=<%=rst("id")%>>删除</a></td>
</tr>
<% rst.movenext
if rst.eof then exit for
next
else
response.write "<tr><td colspan=13><marquee scrolldelay=120 behavior=alternate>没有找到任何记录!!!</marquee></td></tr>"
end if
rst.close
set rst=nothing
%>
</table>
</table>
</div>
<table width="748" border="0" align="center">
<tr>
<td height="17">
<div align="right">
<input type="hidden" name="page" value="<%=NoncePage%>">
<%
if NoncePage>1 then
response.write "|<a href=info_manager.asp?page=1>首 页</a>| |<a href=?page="&NoncePage-1&">上一页</a>| "
else
response.write "|首 页| |上一页| "
end if
if Cint(Trim(NoncePage))<Cint(Trim(NumPage)) then
response.write "|<a href=?page="&NoncePage+1&">下一页</a>| |<a href=?page="&NumPage&">尾 页</a>|"
else
response.write "|下一页| |尾 页|"
end if
%>
页次:<font color="#0033CC"><%=NoncePage%></font>/<font color="#0033CC"><%=NumPage%></font>
共<font color="#0033CC"><%=NumRecord%></font>条记录 </div>
</td>
</table>
</center>
</body>
</html>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<TABLE width="90%" BORDER="0" ALIGN="center" CELLPADDING="0" CELLSPACING="1" BGCOLOR="#D2D2E4">
<TR BGCOLOR="#FFFFFF">
<TD ALIGN="center" VALIGN="middle" bgcolor="#FFFFFF"><A HREF="?page=<%=firstpage%>&bigclass=<%=bigclass%>"><FONT FACE="webdings">9</FONT></A></TD>
<TD ALIGN="center"><% if page-1>=1 then
last=page-1
else
last=1
end if
%>
<A HREF="?page=<%=last%>&bigclass=<%=bigclass%>"><FONT FACE="webdings">3</FONT></A></TD>
<%
if pagecount<=7 then
for i=1 to pagecount
if page=i then
response.Write "<td width=""20"" align=""center"" bgcolor=""#C2F2FF"">"&i&"</td>"
else
response.Write "<td width=""20"" align=""center""><a href=?page="&i&"&bigclass="&bigclass&">"&i&"</a></td>"
end if
next
else
if page<=6 then
for i=1 to 7
if page=i then
response.Write "<td width=""20"" align=""center"" bgcolor=""#C2F2FF"">"&i&"</td>"
else
response.Write "<td width=""20"" align=""center""><a href=?page="&i&"&bigclass="&bigclass&">"&i&"</a></td>"
end if
next
else
if page+3<pagecount then
for i=page-3 to page+3
if page=i then
response.Write "<td width=""20"" align=""center"" bgcolor=""#C2F2FF"">"&i&"</td>"
else
response.Write "<td width=""20"" align=""center""><a href=?page="&i&"&bigclass="&bigclass&">"&i&"</a></td>"
end if
next
else
for i=pagecount-6 to pagecount
if page=i then
response.Write "<td width=""18"" align=""center"" bgcolor=""#C2F2FF"">"&i&"</td>"
else
response.Write "<td width=""20"" align=""center""><a href=?page="&i&"&bigclass="&bigclass&">"&i&"</a></td>"
end if
next
end if
end if
end if
'////
%>
<TD ALIGN="center"><%
if page+1<=pagecount then
np=page+1
else
np=pagecount
end if
%>
<A HREF="?page=<%=np%>&bigclass=<%=bigclass%>"><FONT FACE="webdings">4</FONT></A></TD>
<TD ALIGN="center" VALIGN="middle"><A HREF="?page=<%=pagecount%>&bigclass=<%=bigclass%>"><FONT FACE="webdings">:</FONT></A><A HREF="?page=<%=np%>"></A></TD>
<TD ALIGN="right" VALIGN="middle" bgcolor="#FFFFFF"><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
<FORM ACTION="" METHOD="get">
<TR>
<TD> PAGE:
<INPUT NAME="page" TYPE="text" ID="page4" VALUE="<%=page%>" SIZE="1">
<INPUT TYPE="submit" NAME="Submit" VALUE="GO">
<INPUT NAME="bigclass" TYPE="hidden" ID="bigclass" VALUE="<%=id%>">
</TD>
<TD>ALL:</TD>
<TD>-<%=pagecount%>-</TD>
<TD>PAGE</TD>
</TR>
</FORM>
</TABLE></TD>
</TR>
</TABLE>
<TR BGCOLOR="#FFFFFF">
<TD ALIGN="center" VALIGN="middle" bgcolor="#FFFFFF"><A HREF="?page=<%=firstpage%>&bigclass=<%=bigclass%>"><FONT FACE="webdings">9</FONT></A></TD>
<TD ALIGN="center"><% if page-1>=1 then
last=page-1
else
last=1
end if
%>
<A HREF="?page=<%=last%>&bigclass=<%=bigclass%>"><FONT FACE="webdings">3</FONT></A></TD>
<%
if pagecount<=7 then
for i=1 to pagecount
if page=i then
response.Write "<td width=""20"" align=""center"" bgcolor=""#C2F2FF"">"&i&"</td>"
else
response.Write "<td width=""20"" align=""center""><a href=?page="&i&"&bigclass="&bigclass&">"&i&"</a></td>"
end if
next
else
if page<=6 then
for i=1 to 7
if page=i then
response.Write "<td width=""20"" align=""center"" bgcolor=""#C2F2FF"">"&i&"</td>"
else
response.Write "<td width=""20"" align=""center""><a href=?page="&i&"&bigclass="&bigclass&">"&i&"</a></td>"
end if
next
else
if page+3<pagecount then
for i=page-3 to page+3
if page=i then
response.Write "<td width=""20"" align=""center"" bgcolor=""#C2F2FF"">"&i&"</td>"
else
response.Write "<td width=""20"" align=""center""><a href=?page="&i&"&bigclass="&bigclass&">"&i&"</a></td>"
end if
next
else
for i=pagecount-6 to pagecount
if page=i then
response.Write "<td width=""18"" align=""center"" bgcolor=""#C2F2FF"">"&i&"</td>"
else
response.Write "<td width=""20"" align=""center""><a href=?page="&i&"&bigclass="&bigclass&">"&i&"</a></td>"
end if
next
end if
end if
end if
'////
%>
<TD ALIGN="center"><%
if page+1<=pagecount then
np=page+1
else
np=pagecount
end if
%>
<A HREF="?page=<%=np%>&bigclass=<%=bigclass%>"><FONT FACE="webdings">4</FONT></A></TD>
<TD ALIGN="center" VALIGN="middle"><A HREF="?page=<%=pagecount%>&bigclass=<%=bigclass%>"><FONT FACE="webdings">:</FONT></A><A HREF="?page=<%=np%>"></A></TD>
<TD ALIGN="right" VALIGN="middle" bgcolor="#FFFFFF"><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
<FORM ACTION="" METHOD="get">
<TR>
<TD> PAGE:
<INPUT NAME="page" TYPE="text" ID="page4" VALUE="<%=page%>" SIZE="1">
<INPUT TYPE="submit" NAME="Submit" VALUE="GO">
<INPUT NAME="bigclass" TYPE="hidden" ID="bigclass" VALUE="<%=id%>">
</TD>
<TD>ALL:</TD>
<TD>-<%=pagecount%>-</TD>
<TD>PAGE</TD>
</TR>
</FORM>
</TABLE></TD>
</TR>
</TABLE>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<%
set conn=server.createobject("adodb.connection")
conn.open("DRIVER=Driver do Microsoft Access (*.mdb);UID=admin;pwd=;dbq="&server.mappath("1.mdb"))
set rs=server.createobject("adodb.recordset")
sql="select * from student"
rs.open sql,conn,3
rs.pagesize=20
if request("page")<>"" then
epage=cint(request("page"))
if epage<1 then epage=1
if epage>rs.pagecount then epage=rs.pagecount
else
epage=1
end if
rs.absolutepage=epage
%>
<table border="0" cellpadding="0" cellspacing="1" bgcolor="#0000FF" width="80%" align="center">
<tr bgcolor="#FFFFFF" align="center">
<th><%=rs(0).name%></th><th><%=rs(1).name%></th><th><%=rs(2).name%></th>
</tr>
<%
for i=0 to rs.pagesize-1
if rs.bof or rs.eof then exit for
%>
<tr bgcolor="#FFFFFF" align="center">
<td><%=rs(0).value%></td><td><%=rs(1).value%></td><td><%=rs(2).value%></td>
</tr>
<%
rs.movenext()
next
%>
</table>
<p align="center">
<a href="">首页</a>
<a href="index.asp?page=<%=epage-1%>">前一页</a>
<a href="index.asp?page=<%=epage+1%>">后一页</a>
<a href="index.asp?page=<%=rs.pagecount%>">末页</a>
</p>
<p align="center">现在是第<%=epage%>页一共有<%=rs.pagecount%>页</p>
<%
conn.close()
%>
这是我写的分页,看看有用没有
set conn=server.createobject("adodb.connection")
conn.open("DRIVER=Driver do Microsoft Access (*.mdb);UID=admin;pwd=;dbq="&server.mappath("1.mdb"))
set rs=server.createobject("adodb.recordset")
sql="select * from student"
rs.open sql,conn,3
rs.pagesize=20
if request("page")<>"" then
epage=cint(request("page"))
if epage<1 then epage=1
if epage>rs.pagecount then epage=rs.pagecount
else
epage=1
end if
rs.absolutepage=epage
%>
<table border="0" cellpadding="0" cellspacing="1" bgcolor="#0000FF" width="80%" align="center">
<tr bgcolor="#FFFFFF" align="center">
<th><%=rs(0).name%></th><th><%=rs(1).name%></th><th><%=rs(2).name%></th>
</tr>
<%
for i=0 to rs.pagesize-1
if rs.bof or rs.eof then exit for
%>
<tr bgcolor="#FFFFFF" align="center">
<td><%=rs(0).value%></td><td><%=rs(1).value%></td><td><%=rs(2).value%></td>
</tr>
<%
rs.movenext()
next
%>
</table>
<p align="center">
<a href="">首页</a>
<a href="index.asp?page=<%=epage-1%>">前一页</a>
<a href="index.asp?page=<%=epage+1%>">后一页</a>
<a href="index.asp?page=<%=rs.pagecount%>">末页</a>
</p>
<p align="center">现在是第<%=epage%>页一共有<%=rs.pagecount%>页</p>
<%
conn.close()
%>
这是我写的分页,看看有用没有
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
代码可能错误!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
晕,太长,懒得看,建议把相关文件压缩然后让人家下载
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询