【问题标题】:asp pagination problemasp分页问题
【发布时间】:2011-12-02 03:26:44
【问题描述】:

您好,我对这个 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  

【问题讨论】:

  • 愚蠢的问题,但是你有打开和关闭的表格标签吗?您可以发布此代码的结果 html 吗?

标签: asp-classic pagination paging


【解决方案1】:

您应该在 if...end if 中移动 i (i=i+1) 的增量,因为如果 i 为 9 并且您遇到两个不是 'A' 的 chrEditions 那么 i 将变为 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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-09-07
    • 1970-01-01
    • 2013-01-03
    • 2011-10-26
    相关资源
    最近更新 更多