我对这个asp分页有疑问。它似乎将所有链接放在一行中,所以我认为它可能与int i的检查有关... 但我不熟悉asp。任何人都可以解释这个问题。
这个文件夹包含每月每天的pdf,名为A08P2.pdf A09P2.pdf等......
由于
i = 1
Set fc = f.Files
Set ff = f.SubFolders
For Each f1 in fc
intPage = cint(mid(f1.name,2,2))
chrEdition = mid(f1.name,1,1)
if chrEdition = "A" then
if i = 1 then
Response.Write "<tr>"
end if
Response.Write "<td width='40' align='center'><a href=" & sUP & f1.name & " class='blue_11px'>" & intPage & "</a></td>"
if i = 10 then
Response.Write "</tr>"
i = 0
end if
end if
i = i + 1
Next
答案 0 :(得分:2)
你应该在if ... end中移动i(i = i + 1)的增量if,因为如果我是9并且你遇到两个不是'A'的chrEditions那么我将变成11并且将会从不匹配收盘条件i = 10:
if chrEdition = "A" then
if i = 1 then
Response.Write "<tr>"
end if
Response.Write "<td width='40' align='center'><a href=" & sUP & f1.name & " class='blue_11px'>" & intPage & "</a></td>"
if i = 10 then
Response.Write "</tr>"
i = 0
end if
i = i + 1
end if