Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

tibro

Paginação

Recommended Posts

Pessoal o seguinte:

 

Está ocorrendo um erro na minha paginação.

 

Imagem Postada

 

Está imagem acima é o meu sistema, está aparecendo Páginas, 1, 2 e 3, só que quando eu clico na 3 não aparece nada, só que um "detalhe importante: tem mais matéria só que não é exibida".

 

Sistema como que fica na pagina 3 (não é exibida mais nada além disto)

Imagem Postada

 

vou postar o codigo abaixo:

 

<!--#include file="Conexao.asp"--><%set rs = createobject("adodb.recordset")set rs.activeconnection = conexao%><html><head><title>Paginacao</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css"><style type="text/css"><!--a:link {	color: #000000;	text-decoration: none;}a:visited {	text-decoration: none;	color: #333333;}a:hover {	text-decoration: underline;	color: #000000;}a:active {	text-decoration: none;	color: #333333;}body,td,th {	font-family: Times New Roman, Times, serif;}.style9 {font-size: 12px; color: #0066FF;}a {	font-family: Times New Roman, Times, serif;	font-size: 12px;}body {	margin-left: 0px;	margin-top: 0px;	margin-right: 0px;	margin-bottom: 0px;	background-color: #F9F9F9;}a:link {	color: #333333;}.style15 {color: #666666}--></style></head><body><form name="Paginacao"  method="post"><%  Dim SQL  Dim RS  Dim Contador  Dim Pagina  regs = 9 'DEFININDO A QUANTIDADE DE RESULTADOS POR PÁGINA  pag = request.querystring("pagina") 'ESTA É A QUERYSTRING QUE APRESENTARÁ A PÁGINA ATUAL, E AS DEMAIS...  if pag = "" Then	pag = 1  end if  RS.cursortype = 3 'DEFININDO O CURSOR A SER UTILIZADO  RS.pagesize = regs 'PEGANDO A QUANTIDADE DE RESULTADO POR PÁGINA DEFINIDO ANTERIORMENTE	SQL = "select * from noticias order by data desc"	Set RS = Conexao.Execute (SQL)	RS.PAGESIZE=REGS  If RS.Eof Or RS.Bof then  %>	<td><p align="center">Nenhum registro encontrado!</td></table>  <%  Else	RS.absolutepage = pag	contador = 0  %>  <table width="475" border="0" cellpadding="0" cellspacing="0"> <% Do While not Rs.Eof And Contador < RS.pagesize %><tr align="left" valign="top"> <% 	link = "<a href='ver_materia.asp?id=" & id & "' target=_top>" & date1 &  " </a> "   %> <%	 link2 = "<a href='ver_materia.asp?id=" & id & "' target=_top>" & description &  "</a>" %>  <th width="14%" class="style9" scope="col">						<% 						  id = rs("ID")						  date1 = rs("data") 						  %>		  <% =link%> </th>		<th width="86%" bgcolor="#F9F9F9" class="style10" scope="col"> <%							name1 = rs("materia")							description = name1							 %>		  <% =link2 %></th></tr><tr align="left" valign="top">  <td colspan="2"><span class="style9"><img src="../imagens/notbarras.jpg" width="475" height="7"></span></td>  </tr>   <%	   Contador = Contador +1	 RS.Movenext	Loop   %><tr>  <td colspan="2"><div align="center"><span class="style15">Últimas Notícias</span> - Pagina(s):		<%  End If  For I = 1 to RS.pagecount	If I = Cint(pag) Then	  response.write "<b>" & i & "</b>"	Else	  Pagina = i & "º" & "" & "Página"	  response.write " <a title="& Pagina & " href='" & request.servervariables("script_name") & "?pagina=" & i & "'>" & i & "</a> "	End If  Next	RS.Close	Set RS = Nothing	Conexao.Close	Set Conexao = Nothing  %>  </div></td></tr>  </table></div></form></body></html>
Espero que voces me ajudem

Compartilhar este post


Link para o post
Compartilhar em outros sites

<!--#include file="Conexao.asp"--><%set rs = createobject("adodb.recordset")set rs.activeconnection = conexao%><html><head><title>Paginacao</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css"><style type="text/css"><!--a:link {color: #000000;text-decoration: none;}a:visited {text-decoration: none;color: #333333;}a:hover {text-decoration: underline;color: #000000;}a:active {text-decoration: none;color: #333333;}body,td,th {font-family: Times New Roman, Times, serif;}.style9 {font-size: 12px; color: #0066FF;}a {font-family: Times New Roman, Times, serif;font-size: 12px;}body {margin-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 0px;background-color: #F9F9F9;}a:link {color: #333333;}.style15 {color: #666666}--></style></head><body><form name="Paginacao" method="post"><%Dim SQLDim RSDim ContadorDim Paginaregs = 9 'DEFININDO A QUANTIDADE DE RESULTADOS POR PÁGINApag = request.querystring("pagina") 'ESTA É A QUERYSTRING QUE APRESENTARÁ A PÁGINA ATUAL, E AS DEMAIS...if pag = "" Thenpag = 1end ifRS.cursortype = 3 'DEFININDO O CURSOR A SER UTILIZADORS.pagesize = regs 'PEGANDO A QUANTIDADE DE RESULTADO POR PÁGINA DEFINIDO ANTERIORMENTESQL = "select * from noticias order by data desc"Set RS = Conexao.Execute (SQL)If RS.Bof then%><td><p align="center">Nenhum registro encontrado!</td></table><%ElseRS.absolutepage = pagcontador = 1%><table width="475" border="0" cellpadding="0" cellspacing="0"><% Do While not Rs.Eof And Contador <= RS.pagesize %><tr align="left" valign="top"><% link = "<a href='ver_materia.asp?id=" & id & "' target=_top>" & date1 & " </a> "%><%link2 = "<a href='ver_materia.asp?id=" & id & "' target=_top>" & description & "</a>"%><th width="14%" class="style9" scope="col"><% id = rs("ID")date1 = rs("data") %><% =link%> </th><th width="86%" bgcolor="#F9F9F9" class="style10" scope="col"> <%name1 = rs("materia")description = name1%> <% =link2 %></th></tr><tr align="left" valign="top"><td colspan="2"><span class="style9"><img src="../imagens/notbarras.jpg" width="475" height="7"></span></td></tr><%Contador = Contador + 1RS.MovenextLoop%><tr><td colspan="2"><div align="center"><span class="style15">Últimas Notícias</span> - Pagina(s):<%End IfFor I = 1 to RS.pagecountIf I = Cint(pag) Thenresponse.write "<b>" & i & "</b>"ElsePagina = i & "º" & "" & "Página"response.write " <a title="& Pagina & " href='" & request.servervariables("script_name") & "?pagina=" & i & "'>" & i & "</a> "End IfNextRS.CloseSet RS = NothingConexao.CloseSet Conexao = Nothing%></div></td></tr></table></div></form></body></html>

Ve se agora vai, fiz umas 3 pequenasmodificações... caso não der, quando eu chegar em casa, tento te ajudar again ;)

Compartilhar este post


Link para o post
Compartilhar em outros sites

Aeeeee Alexandre, Valeu Cara

 

Deu certinho!!!!

 

Muito Obrigado!!!!!!

 

mas ae o q tava de errado?

 

mas muito obrigado!!!! valeu

Compartilhar este post


Link para o post
Compartilhar em outros sites

ahauhahua o que arrumei foi- tinha 2 pagesize- joguei o while o if apenas para if rs.eof e while not rs.eof- e mandei o contador começar do 1 e mando ele ver se é <= contadorsó =Pabraços

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.