ASP中关于帖子分页显示的基本方法

Do while not (RS is nothing)

RowCount = RS.PageSize

Do While Not RS.EOF and rowcount > 0

If n=1 then

Response.Write "< TR BGCOLOR=#FFFFFF>"

ELSE

Response.Write "< TR BGCOLOR=#EEEEEE>"

End If

n=1-n >

< TD>< span style="font-size:9pt">< A href=’view.asp?key=< =RS("ID")>’>< =RS("subject")>< /A>< /span>< /td>

< TD>< span style="font-size:9pt">< =RS("name")>< /A>< /span>< /td>

< TD>< span style="font-size:9pt">< a href="mailto:< =RS("email")>">< =RS("email")>< /a>< /span> < /TD>

< TD>< span style="font-size:9pt">< =RS("postdate")>< /span> < /td>

< /TR>

<

RowCount = RowCount - 1

RS.MoveNext

Loop

set RS = RS.NextRecordSet

Loop

Conn.Close

set rs = nothing

set Conn = nothing

>

< /TABLE >

< FORM METHOD=GET ACTION="list.asp" >

< INPUT TYPE="HIDDEN" NAME="pageno" VALUE="< =PageNo >" >

<

if PageNo > 1 Then

response.write "< INPUT TYPE=SUBMIT NAME=’ScrollAction’ VALUE=’
上一页 ’>"

end if

if RowCount = 0 and PageNo < >Total then

response.write "< INPUT TYPE=SUBMIT NAME=’ScrollAction’ VALUE=’
下一页 ’>"

end if

response.write "< /FORM>"

End if

>

< End Sub
>