标题:asp中 mod运用问题
取消只看楼主
bluesir
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2008-10-14
 问题点数:0 回复次数:2 
asp中 mod运用问题
这是一个广告显示,我想做成三行 每行4个图片 下面我弄得有些错误 请高手帮助改正一下 谢谢!! Rs.Open Sql , Conn , 1 , 1
If Rs.Eof Then
Ind_01 = ""
Ind_01 = Ind_01 & "<table align=""center"" width=""730"" border=""0"" cellpadding=""0"" cellspacing=""0"">"
For i = 1 To 3
Ind_01 = Ind_01 & "<tr>"
For j = 1 To 4
Ind_01 = Ind_01 & "<td width=""180"" height=""60"" valign=""top""><img src=""Images/Ad_Ind_02_def.jpg"" width=""155"" height=""50"" border=""0"" /></td>"
Next
Ind_01 = Ind_01 & "</tr>"
Next
Ind_01 = Ind_01 & "</table>"
Else
Ind_01 = ""
Ind_01 = Ind_01 & "<table align=""center"" width=""730"" border=""0"" cellpadding=""0"" cellspacing=""0"">"
Ind_01 = Ind_01 & "<tr>"
i = 0
Do While Not Rs.Eof
Ind_01 = Ind_01 & "<td width=""180"" height=""60"" valign=""top"">"
If Rs("AdType") = "1" Then
Ind_01 = Ind_01 & "<object classid=""clsid27CDB6E-AE6D-11cf-96B8-444553540000"" codebase=""http://download.,0,19,0"" width=""155"" height=""50"">"
Ind_01 = Ind_01 & "<param name=""movie"" value="""& Rs("AdPicUrl") &""" />"
Ind_01 = Ind_01 & "<param name=""quality"" value=""high"" />"
Ind_01 = Ind_01 & "<embed src="""& Rs("AdPicUrl") &""" quality=""high"" pluginspage=""http://www. type=""application/x-shockwave-flash"" width=""155"" height=""50""></embed>"
Ind_01 = Ind_01 & "</object>"
Else
If Rs("AdUrl") <> "" And Rs("AdUrl") <> "http://" Then
Ind_01 = Ind_01 & "<a href="""& Rs("AdUrl") &""" target=""_blank""><img src="""& Rs("AdPicUrl") &""" width=""155"" height=""50"" border=""0"" /></a>"
Else
Ind_01 = Ind_01 & "<img src="""& Rs("AdPicUrl") &""" width=""155"" height=""50"" border=""0"" />"
End If
End If
Ind_01 = Ind_01 & "</td>"
Rs.MoveNext
i = i + 1
If i >= 12 Then Exit Do
If i Mod 4 = 0 And Not Rs.Eof Then Ind_01 = Ind_01 & "</tr><tr>"
If ((i\3) + 1 < 2 Or i Mod 3 > 0) And Rs.Eof Then
If i Mod 3 > 0 Then
For j = (i Mod 4) + 1 To 4
Ind_01 = Ind_01 & "<td width=""180"" height=""60"" valign=""top""><img src=""Images/Ad_Ind_02_def.jpg"" width=""155"" height=""50"" border=""0"" /></td>"
Next
End If
If (i\3) + 1 < 2 Then
For i = (i\3) + 3 To 4
Ind_01 = Ind_01 & "<tr>"
For j = 1 To 4
Ind_01 = Ind_01 & "<td width=""180"" height=""60"" valign=""top""><img src=""Images/Ad_Ind_02_def.jpg"" width=""155"" height=""50"" border=""0"" /></td>"
Next
Ind_01 = Ind_01 & "</tr>"
Next
请高手帮助解决一下!!谢谢!!主要是上面的蓝色部分,调用12个 每行4个 显示三行
搜索更多相关主题的帖子: mod asp 
2008-10-14 14:25
bluesir
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2008-10-14
得分:0 
回复 2# yms123 的帖子
按照您的改法,修改后还是不行,直接显示一行了,我把那个文件发上来,请帮我看一下吧,谢谢!!不能发附件,我给个下载地址

http://www.  修改后如果可以请发到我的邮箱 bluesirhao@  非常感谢!!
2008-10-14 15:04
bluesir
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2008-10-14
得分:0 
再一次求助 asp中 mod运用问题
asp中 mod运用问题
这是一个广告显示,我想做成三行 每行4个图片 下面我弄得有些错误 请高手帮助改正一下 谢谢!!

Rs.Open Sql , Conn , 1 , 1
If Rs.Eof Then
Ind_01 = ""
Ind_01 = Ind_01 & "<table align=""center"" width=""730"" border=""0"" cellpadding=""0"" cellspacing=""0"">"
For i = 1 To 3
Ind_01 = Ind_01 & "<tr>"
For j = 1 To 4
Ind_01 = Ind_01 & "<td width=""180"" height=""60"" valign=""top""><img src=""Images/Ad_Ind_02_def.jpg"" width=""155"" height=""50"" border=""0"" /></td>"
Next
Ind_01 = Ind_01 & "</tr>"
Next
Ind_01 = Ind_01 & "</table>"
Else
Ind_01 = ""
Ind_01 = Ind_01 & "<table align=""center"" width=""730"" border=""0"" cellpadding=""0"" cellspacing=""0"">"
Ind_01 = Ind_01 & "<tr>"
i = 0
Do While Not Rs.Eof
Ind_01 = Ind_01 & "<td width=""180"" height=""60"" valign=""top"">"
If Rs("AdType") = "1" Then
Ind_01 = Ind_01 & "<object classid=""clsid27CDB6E-AE6D-11cf-96B8-444553540000"" codebase=""http://download.,0,19,0"" width=""155"" height=""50"">"
Ind_01 = Ind_01 & "<param name=""movie"" value="""& Rs("AdPicUrl") &""" />"
Ind_01 = Ind_01 & "<param name=""quality"" value=""high"" />"
Ind_01 = Ind_01 & "<embed src="""& Rs("AdPicUrl") &""" quality=""high"" pluginspage=""http://www. type=""application/x-shockwave-flash"" width=""155"" height=""50""></embed>"
Ind_01 = Ind_01 & "</object>"
Else
If Rs("AdUrl") <> "" And Rs("AdUrl") <> "http://" Then
Ind_01 = Ind_01 & "<a href="""& Rs("AdUrl") &""" target=""_blank""><img src="""& Rs("AdPicUrl") &""" width=""155"" height=""50"" border=""0"" /></a>"
Else
Ind_01 = Ind_01 & "<img src="""& Rs("AdPicUrl") &""" width=""155"" height=""50"" border=""0"" />"
End If
End If
Ind_01 = Ind_01 & "</td>"
Rs.MoveNext
i = i + 1
If i >= 12 Then Exit Do
If i Mod 4 = 0 And Not Rs.Eof Then Ind_01 = Ind_01 & "</tr><tr>"
If ((i\3) + 1 < 2 Or i Mod 3 > 0) And Rs.Eof Then
If i Mod 3 > 0 Then
For j = (i Mod 4) + 1 To 4
Ind_01 = Ind_01 & "<td width=""180"" height=""60"" valign=""top""><img src=""Images/Ad_Ind_02_def.jpg"" width=""155"" height=""50"" border=""0"" /></td>"
Next
End If
If (i\3) + 1 < 2 Then
For i = (i\3) + 3 To 4
Ind_01 = Ind_01 & "<tr>"
For j = 1 To 4
Ind_01 = Ind_01 & "<td width=""180"" height=""60"" valign=""top""><img src=""Images/Ad_Ind_02_def.jpg"" width=""155"" height=""50"" border=""0"" /></td>"
Next
Ind_01 = Ind_01 & "</tr>"
Next
请高手帮助解决一下!!谢谢!!主要是上面的蓝色部分,调用12个 每行4个 显示三行

附件中是文件


非常感谢!!

asp.rar (1.49 KB) 文件

2008-10-15 20:14



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-238187-1-1.html




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

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