Hoşgeldiniz, Ziyaretçi.Lütfen giriş yapın veya kayıt olun.
E-posta adresinize aktivasyon iletisi gelmediyse lütfen buraya tıklayın.
Mayıs 18, 2012, 08:06:41 ÖÖ

 
 
  
 
Ana Sayfa Ana Sayfa Yardım Ara Giriş Yap Kayıt
+  Hay-NS Yazılım
|-+  WEB TABANLI DİLLER
| |-+  ASP Köşesi
| | |-+  ASP Kod Bankası
| | | |-+  Sayfalama Şekilleri -2- fonksiyonlu
0 Üye ve 1 Ziyaretçi konuyu incelemekte. « önceki sonraki »
Sayfa: [1] Aşağı git Bu Konuyu Gönder Yazdır
Gönderen Konu: Sayfalama Şekilleri -2- fonksiyonlu  (Okunma Sayısı 404 defa)
turkoder
Adnan YILDIZ
Administrator
Onbaşı
*****

Rep Puanı: +0/-0
Çevrimdışı Çevrimdışı

Mesaj Sayısı: 208



WWW
« : Ekim 09, 2006, 06:42:57 ÖS »

Örnek :


Kod:
<font face="Verdana" size="2" color="#0000FF"><b>Listelenen Kayıtlar :</b></font>
 
 <%
   
 id=request.querystring("id")
 
   intPage = cInt(Request.QueryString("page"))
 If (intPage = 0) or (intpage="") then
 intPage = 1
 end if
liste_sayisi= 7

Set rs=Server.CreateObject("Adodb.Recordset")
Sorgu="Select * from topik where id="&id&" "
'On Error Resume Next
yna.Open Sorgu, bag, 1, 3
If rs.EOF Then
Response.write"İlgili Kayıta rastlanamadı"
response.end
Else
 
messagecount = rs.Recordcount
 
rs.PageSize = cint(liste_sayisi)
rs.AbsolutePage = intPage
sayfa1= rs.PageCount
 
%>
<font face="Verdana" size="2"><%=sfysirala()%></font>
 <table border="0" width="100%" style="border-style: solid; border-width: 1" bordercolor="#C0C0C0">
 
 <%
 i=1
 
for j=1 to rs.pagesize
if rs.eof then exit for
baslik= rs("baslik")
%>
<%if i mod 2 then
renk="F2F2F2"
else
renk="ffffff"
end if
%>
  <tr>
    <td width="3%" bgcolor="#<%=renk%>"><%response.write i%></td>
    <td width="97%" bgcolor="#<%=renk%>" colspan="2"><%=baslik%></td>
  </tr>
<% 
  i=i+1
  rs.movenext
  next
     end if 
 rs.close
 set rs=nothing       
               
%> <tr>
    <td width="3%" bgcolor="#<%=renk%>">   
</td>
    <td width="24%" bgcolor="#<%=renk%>"><font face="Verdana" size="2"> <b>Toplam Kayıt:</b>&nbsp;<%=messagecount%> </font></td>
    <td width="73%" bgcolor="#<%=renk%>"><font face="Verdana" size="2"><%=sfysirala()%></font> </td>
  </tr>
</table>

Fonksiyonumuz :
Kod:
<%
Function sfysirala()
If (messagecount/ liste_sayisi) <> Fix(messagecount/ liste_sayisi) then
intposts = Fix(messagecount/ liste_sayisi) + 1
else
intposts = (messagecount/ liste_sayisi)
end if
if intPosts >= 1 then
Sayfa="Sayfa"
Response.Write "<br /><div style=""text-align=right;""><span class=""stort"">" & Sayfa & ": " & intPosts & " (</span>"
If intPage > 1 Then
Response.Write "<a href=""?page=1" & "&id=" & id& """> İlk Sayfa  </a> ... "
 Response.write "<a href=""?page=" & intPage-1 & "&id=" & id& """><<</a> "
End If
For i = intpage-4 to intpage+4
If i > intPosts Then Exit For
if  i <> cint(intPage) Then
If i >= 1 Then
 response.write "<a href=""?page=" & i &"&id=" & id& """>" & i & "</a> "
End If
else
response.write "&nbsp;<a href=""#"">[" & i & "]</a> "

end if
Next
If intPage + 1 =< intposts Then

 Response.write "<a href=""?page=" & intPage+1 &"&id=" & id& """>>></a> "
 
Response.write " ... <a href=""?page=" & intPosts &"&id=" & id& """>Son Sayfa</a>"

End if

Response.Write "<span class=""stort"">)</span></div>"
end if

 
End Function
 
%>
Logged
Sayfa: [1] Yukarı git Bu Konuyu Gönder Yazdır 
« önceki sonraki »
Gitmek istediğiniz yer:  


Kullanıcı adınızı, parolanızı ve aktif kalma süresini giriniz

MySQL Kullanıyor PHP Kullanıyor Powered by SMF 1.1.8 | SMF © 2006-2008, Simple Machines LLC XHTML 1.0 Uyumlu! CSS Uyumlu!
Bu Sayfa 0.032 Saniyede 19 Sorgu ile Oluşturuldu