 |
本文相关内容 |
 |
|
|
|
|
|
| |
★asp网页制作问题,高手帮我改改,现在是每行显示1个图片,改成每行显示4个,希望改了就好用
|
|
|
asp网页制作问题,高手帮我改改,现在是每行显示1个图片,改成每行显示4个,希望改了就好用
|
| 添加记录:
网页制作
类别:
网页制作
发布日期:
2006.09.20
|
问:
<table width="96%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><%set rs=server.createobject("adodb.recordset")rs.open "select * from nasuo_jcsj order by bookid desc",conn,1,3if rs.recordcount=0 then %> <%else rs.PageSize =4 '每页记录条数iCount=rs.RecordCount '记录总数iPageSize=rs.PageSize maxpage=rs.PageCount page=request("page") if Not IsNumeric(page) or page="" then page=1 else page=cint(page) end if if page<1 then page=1 elseif page>maxpage then page=maxpage end if rs.AbsolutePage=Pageif page=maxpage thenx=iCount-(maxpage-1)*iPageSizeelsex=iPageSizeend if For i=1 To x %> <br> <%if rs("bookpic")<>"" then response.write "<a href="&trim(rs("bookpic2"))&" target=_blank><img src="&trim(rs("bookpic"))&" width=174 height=139 border=0></a>"elseresponse.write "<img src=images/emptybook.gif width=174 height=139 border=0>"end if%> <p><%=rs("bookname")%> <%if len(trim(rs("bookcontent")))>150 thenresponse.write left(trim(rs("bookcontent")),120)&"..."elseresponse.write left(trim(rs("bookcontent")),100)end if%> <a href="nasuo_jcsj.asp?id=<%=rs("bookid")%>" target="_blank">详细信息></a></p> <%rs.movenextnext'call PageControl(iCount,maxpage,page,"border=0 align=center","<p align=center>")end ifrs.closeset rs=nothingSub PageControl(iCount,pagecount,page,table_style,font_style)'生成上一页下一页链接 Dim query, a, x, temp action = "hjcsjp://" & Request.ServerVariables("HjcsjP_HOST") & Request.ServerVariables("SCRIPT_NAME") query = Split(Request.ServerVariables("QUERY_STRING"), "&") For Each x In query a = Split(x, "=") If StrComp(a(0), "page", vbTextCompare) <> 0 Then temp = temp & a(0) & "=" & a(1) & "&" End If Next Response.Write("<table width=100% border=0 cellpadding=0 cellspacing=0>" & vbCrLf ) Response.Write("<form method=get onsubmit=""document.location = '" & action & "?" & temp & "Page='+ this.page.value;return false;""><TR>" & vbCrLf ) Response.Write("<TD align=center height=35>" & vbCrLf ) Response.Write(font_style & vbCrLf ) if page<=1 then Response.Write ("首 页 " & vbCrLf) Response.Write ("上一页 " & vbCrLf) else Response.Write("<A HREF=" & action & "?" & temp & "Page=1>首 页</A> " & vbCrLf) Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page-1) & ">上一页</A> " & vbCrLf) end if if page>=pagecount then Response.Write ("下一页 " & vbCrLf) Response.Write ("尾 页 " & vbCrLf) else Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page+1) & ">下一页</A> " & vbCrLf) Response.Write("<A HREF=" & action & "?" & temp & "Page=" & pagecount & ">尾 页</A> " & vbCrLf) end if Response.Write(" 页次:" & page & "/" & pageCount & "页" & vbCrLf) Response.Write(" 共有" & iCount & "种商品" & vbCrLf) Response.Write(" 转到" & "<INPUT CLASS=wenbenkuang TYEP=TEXT NAME=page SIZE=2 Maxlength=5 VALUE=" & page & ">" & "页" & vbCrLf & "<INPUT CLASS=go-wenbenkuang type=submit value=GO>") Response.Write("</TD>" & vbCrLf ) Response.Write("</TR></form>" & vbCrLf ) Response.Write("</table>" & vbCrLf ) End Sub%></td> </tr> </table>
答: 抱歉,没时间帮你改你的代码了。我把我的贴出来,你研究研究吧我这个是一行3列的演示地址:http://www.51bjhouse.com/pic.asp<%set rs=server.createobject("adodb.recordset")sql="SELECT * from wz_pic order by id desc "'response.Write(sql)'response.End()rs.open sql,conn,1,1page=request.QueryString("page")if request("page")="" thencurpage = 1elsecurpage = cint(request("page"))end ifrs.pagesize=9rs.absolutepage = curpage if rs.pagesize * curpage <= rs.recordcount thenfor i = 1 to 3'**************************************************************************************************url="html/" & rs("file_url")pic=replace(rs("file_pic"),"../","html/")%><table width="692" border="0" cellspacing="0" cellpadding="0"><tr> <td width="222" align="center" valign="middle"><table width="200" border="0" cellspacing="5" cellpadding="0"><tr><td><img src="<%=pic%>" width="200" height="150" border="0"></td></tr><tr><td height="70" align="center" bgcolor="#f5f5f5"><a href="<%=url%>" target="_blank" ><%=rs("title")%>...</a></td></tr></table></td><td width="11" height="260" background="images/line.gif"> </td> <% rs.movenext url="html/" & rs("file_url") pic=replace(rs("file_pic"),"../","html/") %> <td width="222" align="center" valign="middle"><table width="200" border="0" cellspacing="5" cellpadding="0"><tr><td><img src="<%=pic%>" width="200" height="150" border="0"></td></tr><tr><td height="70" align="center" bgcolor="#f5f5f5"><a href="<%=url%>" target="_blank" ><%=rs("title")%>...</a></td></tr></table></td><td width="11" height="260" background="images/line.gif"> </td> <% rs.movenext url="html/" & rs("file_url") pic=replace(rs("file_pic"),"../","html/") %> <td width="222" align="center" valign="middle"><table width="200" border="0" cellspacing="5" cellpadding="0"><tr><td><img src="<%=pic%>" width="200" height="150" border="0"></td></tr><tr><td height="70" align="center" bgcolor="#f5f5f5"><a href="<%=url%>" target="_blank" ><%=rs("title")%>...</a></td></tr></table></td><td width="11" height="260" background="images/line.gif"> </td> </tr> </table><br> <%'**********************************************************************************************rs.movenextnext%><% elsej= rs.recordcount mod rs.pagesizedo while j>3 url="html/" & rs("file_url")pic=replace(rs("file_pic"),"../","html/") %><table width="692" border="0" cellspacing="0" cellpadding="0"><tr> <td width="222" align="center" valign="middle"><table width="200" border="0" cellspacing="5" cellpadding="0"><tr><td><img src="<%=pic%>" width="200" height="150" border="0"></td></tr><tr><td height="70" align="center" bgcolor="#f5f5f5"><a href="<%=url%>" target="_blank" ><%=rs("title")%>...</a></td></tr></table></td><td width="11" height="260" background="images/line.gif"> </td> <% rs.movenext url="html/" & rs("file_url") pic=replace(rs("file_pic"),"../","html/") %> <td width="222" align="center" valign="middle"><table width="200" border="0" cellspacing="5" cellpadding="0"><tr><td><img src="<%=pic%>" width="200" height="150" border="0"></td></tr><tr><td height="70" align="center" bgcolor="#f5f5f5"><a href="<%=url%>" target="_blank" ><%=rs("title")%>...</a></td></tr></table></td><td width="11" height="260" background="images/line.gif"> </td> <% rs.movenext url="html/" & rs("file_url") pic=replace(rs("file_pic"),"../","html/") %> <td width="222" align="center" valign="middle"><table width="200" border="0" cellspacing="5" cellpadding="0"><tr><td><img src="<%=pic%>" width="200" height="150" border="0"></td></tr><tr><td height="70" align="center" bgcolor="#f5f5f5"><a href="<%=url%>" target="_blank" ><%=rs("title")%>...</a></td></tr></table></td><td width="11" height="260" background="images/line.gif"> </td> </tr> </table><br> <br> <%rs.movenextj=j-3loop%><table width="692" border="0" cellspacing="0" cellpadding="0"><tr><% for i=1 to j url="html/" & rs("file_url")pic=replace(rs("file_pic"),"../","html/")%><td width="222" align="center" valign="middle"><table width="200" border="0" cellspacing="5" cellpadding="0"><tr><td><img src="<%=pic%>" width="200" height="150" border="0"></td></tr><tr><td height="70" align="center" bgcolor="#f5f5f5"><a href="<%=url%>" target="_blank" ><%=rs("title")%>...</a></td></tr></table></td> <%rs.movenext next%> </tr></table><br> <%end if%><%'==========================分页=================================%><table width="690" border="0" cellspacing="0" cellpadding="0" align="center"><tr><td height="31" align="center"><%response.write "<hr size=0 width='98%'>"response.write "第<font color=red>" + cstr(curpage) + "</font>页/总<font color=red>" + cstr(rs.pagecount) + "</font>页 "response.write "<font size=2 >本页</font><font size=2 color=red>" + cstr(i-1) + "</font><font size=2 >条/总</font><font size=2 color=red>" + cstr(rs.recordcount) + "</font><font size=2 >条</font>"if curpage = 1 then %><font color="#000000" >首页 前页</font><%else' ********************keyword1=request("search_wz") sel_leibie=request("sel_leibie")*****************************response.write "<a href='pic.asp?page=1'>首页</a> <a href='pic.asp?page=" & cstr(curpage-1) & "'>前页</a> "end ifif curpage = rs.pagecount then %><font color="#000000">后页 末页</font><%elseresponse.write "<a href='pic.asp?page=" & cstr(curpage+1) &"'>后页</a> <a href='pic.asp?page=" & cstr(rs.pagecount) &"'>末页</a> "end if%></td></tr></table>
该回答在由回答者修改过
|
上一篇:ASP网页制作老手请进,一个很奇怪的故障! 下一篇:ASP网页制作的一个连接问题
|
|
|
 |
电脑常识文选风云榜 |
 |
|