| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 377 人关注过本帖
标题:asp的问题
只看楼主 加入收藏
klkl99889
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2007-11-15
收藏
 问题点数:0 回复次数:4 
asp的问题

我正在坐个图片显示新闻前台,我想每行显示两个或三个小图片标题,例示http://www.makewing.com/lanren/png/这上面是每行显示两个图片,请高手帮我填加一下,谢谢~~~
我的代码如下:

<%
dim conn
dim rst
dim connstr
dim sqlstr
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &server.MapPath("/db/pic.mdb")
set conn=Server.CreateObject("ADODB.CONNECTION")
set rst=Server.CreateObject("ADODB.RECORDSET")
conn.open connstr
%>

<table width="92%" border="0" cellspacing="0" cellpadding="0">
<tr class="ziti">
<td align="center" valign="top" scope="col"><div align="left">

<%set rs=server.createobject("adodb.recordset")
sql="select * from gyhy_qyry where lb='飞机图片' order by ID desc"

rs.open sql,conn,1,1
if rs.recordcount=0 then
%>
<table width="370" border="0" cellspacing="0" cellpadding="5" align="center">
<tr>
<td align=center>暂无内容</td>
</tr>
</table>
<%
else
rs.PageSize =10 '每页记录条数
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=Page

if page=maxpage then
x=iCount-(maxpage-1)*iPageSize
else
x=iPageSize
end if

For i=1 To x
%>


//<%这里好像有代码%>

<table width="100%" border="0" align="center" cellspacing="7">
<tr>
<td align="center" valign="top"><table width="160" border="0" cellpadding="0" cellspacing="0" bgcolor="#000000">
<tr>
<td align="center" valign="top" bgcolor="#FFFFFF">

//<%这里好像有代码%>


<table width="100" cellpadding="0" cellspacing="0" class="bianhui">
<tr>
<td><table border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle" bgcolor="#FFFFFF" class="bianquan"><table width="100%" border="1" cellpadding="2" cellspacing="0" bordercolor="#CCCCCC">
<tr>
<td><img src="<%=rs("maxtu")%>" border="0" width="280" height="165"></a></td>
</tr>
</table></td>
</tr>
</table>
<table width="100%" height="24" border="0" align="center" cellpadding="0" cellspacing="4" class="biantop">
<tr>
<td align="center" valign="bottom" class="ziti" ><div align="center" class="ddyyCopy"><%=rs("biaoti")%> <br>
</div></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
<td align="center" valign="top" bgcolor="#FFFFFF">

<table width="140" height="" border="0" cellpadding="0" cellspacing="0" bgcolor="#000000">
<tr>
<td width="" height="" align="center" valign="top" bgcolor="#FFFFFF"><table width="100" cellpadding="0" cellspacing="0" class="bianhui">
<tr>
<td><table border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle" bgcolor="#FFFFFF" class="bianquan"><table width="100%" border="1" cellpadding="2" cellspacing="0" bordercolor="#CCCCCC">
<tr>
<td><img src="<%=rs("maxtu")%>" border="0" width="280" height="165"></a></td>
</tr>
</table></td>
</tr>
</table>
<table width="100%" height="24" border="0" align="center" cellpadding="0" cellspacing="4" class="biantop" >
<tr>
<td align="center" valign="bottom" class="ziti" ><div align="center"><span class="ddyyCopy"><%=rs("biaoti")%> </span><br>
</div></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>

//<%这里好像有代码%>

</td>
</tr>
</table>

//<%这里好像有代码%>

<table width="100%" height="18" border="0" cellpadding="0" cellspacing="0" class="ziti">
<tr>
<th height="18" scope="col"><div align="center" class="ddhh">
<%rs.movenext
next
call PageControl(iCount,maxpage,page,"border=0 align=center","<p align=center>")
end if
rs.close
set rs=nothing
Sub PageControl(iCount,pagecount,page,table_style,font_style)

Dim query, a, x, temp
action = "http://" & Request.ServerVariables("HTTP_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 ("<font face=宋 体 color=#666666 size=2px>首 页 " & vbCrLf)
Response.Write ("<font face=宋 体 color=#666666 size=2px>上一页 " & vbCrLf)
else
Response.Write("<A HREF=" & action & "?" & temp & "Page=1 ><font face=宋 体 color=#666666 size=2px>首 页</A> " & vbCrLf)
Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page-1) & "><font face=宋 体 color=#666666 size=2px>上一页</A> " & vbCrLf)
end if

if page>=pagecount then
Response.Write ("<font face=宋 体 color=#666666 size=2px>下一页 " & vbCrLf)
Response.Write ("<font face=宋 体 color=#666666 size=2px>尾 页 " & vbCrLf)
else
Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page+1) & "><font face=宋 体 color=#666666 size=2px>下一页</A> " & vbCrLf)
Response.Write("<A HREF=" & action & "?" & temp & "Page=" & pagecount & "><font face=宋 体 color=#666666 size=2px>尾 页</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
%></div></th>
</tr>
</table>
<table width="500" height="20" border="0" cellpadding="0" cellspacing="0">
<tr>
<td></td>
</tr>
</table>
</div></td>
</tr>
</table>

上面的代码已调试成功,不过每行是显示两个图片了,可是显示的图片是同样的,标注<%这里好像有代码%>的地方我估计要加什么代码,可小弟搞不出来,请高手吗?帮帮忙啊~~~

搜索更多相关主题的帖子: asp 
2007-11-16 09:34
klkl99889
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2007-11-15
收藏
得分:0 
晕呢,没人帮我啊
2007-11-16 10:52
JaeShin
Rank: 1
等 级:新手上路
帖 子:647
专家分:0
注 册:2007-11-9
收藏
得分:0 
再加个TD试试落~

A ZA ~否则~拉出去斩了!!!!!!!
免费加入,【爱乐答意见网】提供两种网上兼职方式。
http://www..cn/member/cf.aspx?20&jaeshin
2007-11-16 13:02
klkl99889
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2007-11-15
收藏
得分:0 
没人帮我我顶一下
2007-11-17 12:35
klkl99889
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2007-11-15
收藏
得分:0 
为什么没人帮我填加一下啊,再顶
2007-11-18 08:29
快速回复:asp的问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.029786 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved