Aqui está um tutorial detalhado sobre funções de paginação comumente usadas ASP. O método é muito simples. Amigos interessados, vamos aprender sobre isso com o editor!
A cópia do código é a seguinte:
Rs.opensql, Conn, 1,1
ifrs.eofandrs.bofthen
resposta.write "
"
outro
Totalput = Rs.RecordCount
MapperPage = 18
IfCurrentPage
CurrentPage = 1
endif
if (currentpage-1)*maxPage> TotalputThen
if (totalputModMaxPage) = 0then
CurrentPage = Totalput/MaxPage
outro
CurrentPage = Totalput/MaxPage+1
endif
endif
ifCurrentPage = 1THEN
SHOPPAGE1TOTALPUT, MAXPERPAGE, "Infotype.asp?
ShowContent ()
SHOPPAGETOTALPUT, MAXPERPAGE, "Infotype.asp? Id =" & request ("ID")
outro
if (currentpage-1)*maxPage
rs.move (CurrentPage-1)*MaxPage
DimBookmark
Markmark = Rs.Bookmark
SHOPPAGE1TOTALPUT, MAXPERPAGE, "Infotype.asp?
ShowContent
SHOPPAGETOTALPUT, MAXPERPAGE, "Infotype.asp? Id =" & request ("ID")
outro
CurrentPage = 1
SHOPPAGE1TOTALPUT, MAXPERPAGE, "Infotype.asp?
ShowContent
SHOPPAGETOTALPUT, MAXPERPAGE, "Infotype.asp? Id =" & request ("ID")
endif
endif
endif
%>
SubShowContent ()
%>
EU IA
escolher
Título da informação
Data de atualização
Clique
Adicione pessoas
editar
excluir
Gerar [zero]
i = 1
Dowhilenotrs.eof
%>
">
"Target =" _ Blank "> []
strCounts = Truelen (TheTitle1)
Response.WriteThetitle1
%>
DateTime = RS ("DateTime")
yname = ano (datetime)
mname = mês (datetime)
Iflen (Mname)
dname = mês (DateTime)
iflen (dname)
FoldName = yname & mname
%>
/.htm"title="view gerated static page "target =" _ blank ">
"> Modificar
) "> Excluir
) "> Generate (',' ',' largura = 0, altura = 0 ')">)
i = i+1
ifi> maxperpageTeneexitdo
rs.movenext
laço
%>
EU IA
escolher
Título da informação
Data de atualização
Clique
Adicione pessoas
editar
excluir
gerar
endsub
%>
FunctionShowPage (TotalNumber, MaxPage, nome do arquivo)
%>
Dimn
ifTotalNumberModMaxPage = 0Then
n = TotalNumber/MaxPage
outro
n = TotalNumber/MaxPage+1
endif
%>
Existem / itens no total,
Página atual/
[Home] [Página anterior]
"> [Home] & Page ="> [página anterior]
[Próxima página] [última página] & Page = "> [Próxima página] & Page ="> [última página]
Vá para:
OnChange = "location.href = this.options [this.SelectedIndex] .Value">
ifCurrentPage = jthen
%> & Page = "Selecionado>
outro
%>
& página = ">
endif
próximo
%>
Função final
%>
FunctionShowPage1 (TotalNumber, MaxPage, nome do arquivo)
%>
Dimb
ifTotalNumberModMaxPage = 0Then
B = TotalNumber/MaxPage
outro
B = TotalNumber/MaxPage+1
endif
%>
Existem / itens no total,
Página atual/
dxystart = currentPage-5
ifdxystart
dxyend = CurrentPage+5
ifdxyend> bthendxyend = b
fordxy = dxystarttodxyend
ifdxy = currentpagethen
Response.Write "[" & "" & dxy & "" "&"] "e" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" " """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" = vermelho>
outro
Response.write "[" & dxy & "" & "]" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" " """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
endif
próximo
%>
Função final
%>
rs.close
setrs = nada
Conn.Close
setConn = nada
%>
O exposto acima é um tutorial detalhado sobre as funções de paginação Asp. Eu acredito que você aprendeu sobre isso. Para mais conteúdo relacionado, continue prestando atenção ao canal de tecnologia Wonew.