Ciao a tutti, non riesco a far funzionare questo esempio di paginazione preso da aspitalia: non mi da errore ma nemmeno visualizzo il numero di pagine ecc.... Vi posto il codice:

Nel codebehind
Imports System.Data
Imports System.Data.OleDb
Imports System.Configuration

Public Class Team
Inherits System.Web.UI.Page

Dim PageSize As Integer = 2
Dim CurrentPage As String
Dim TotalPages, TotalSize As Integer
Protected WithEvents Paginazione As System.Web.UI.WebControls.PlaceHolder


#Region " Codice generato da Progettazione Web Form "

'Chiamata richiesta da Progettazione Web Form.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

End Sub
Protected WithEvents RTeam As System.Web.UI.WebControls.Repeater
Protected WithEvents lError As System.Web.UI.WebControls.Label

'NOTA: la seguente dichiarazione è richiesta da Progettazione Web Form.
'Non spostarla o rimuoverla.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: questa chiamata al metodo è richiesta da Progettazione Web Form.
'Non modificarla nell'editor del codice.
InitializeComponent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

CurrentPage = Request("p")
If CurrentPage Is Nothing Then CurrentPage = 1
If Not Page.IsPostBack Then BindData()

End Sub

Sub BindData()

Dim DSN As String = ConfigurationSettings.AppSettings("connessione")
Dim Conn As OleDbConnection
Conn = New OleDbConnection(DSN)
Conn.Open()

'TEAM
Dim sqlTeam As String = "SELECT * FROM T_TEAM"
Dim CmdTeam As New OleDbDataAdapter(sqlTeam, Conn)
Dim ds As DataSet = New DataSet
Dim StartRecord As Integer = (Int32.Parse(CurrentPage) - 1) * Int32.Parse(PageSize)

CmdTeam.Fill(ds, StartRecord, Int32.Parse(PageSize), "Team")
RTeam.DataSource = ds
RTeam.DataBind()

Dim sqlConta As String = "SELECT COUNT(*)as Totale FROM T_Team"
Dim cmdConta As OleDbCommand = New OleDbCommand(sqlConta, Conn)
Dim reader As OleDbDataReader = cmdConta.ExecuteReader()
reader.Read()
TotalSize = reader("Totale")
reader.Close()
Conn.Close()

'Mostra l'avviso in alto con il numero dei risultati:
If TotalSize = 0 Then
lrisultati.Text = "non ci snon risultati per questa ricerca."
Else
TotalPages = Int32.Parse(TotalSize) \ Int32.Parse(PageSize) + 1
If Fix(TotalSize / PageSize) = TotalSize / PageSize Then TotalPages = TotalPages - 1
If TotalSize = 1 Then
lrisultati.Text += "Un risultato"
Else
lrisultati.Text += TotalSize & "risultati"
End If

Dim Endrecord As Integer = StartRecord + Int32.Parse(PageSize)
If Endrecord > TotalSize Then Endrecord = TotalSize
lrisultati.text +=" - pagina " & CurrentPage & " su " & Totalsize & " in totale - da " & startrecord + 1 & " a " &
End If

BuidPagers()

End Sub

Private Sub BuidPagers()
Dim i As Integer
Dim lb As Label

If TotalPages > 1 Then
lb = New Label
lb.Text = "Ci sono " & TotalPages & " pagine con i risultati: "
Paginazione.Controls.Add(lb)

For i = 1 To (TotalPages)
lb = New Label
lb.ID = "ThisPage" & i
If CurrentPage = i Then
lb.Text = "[" & i & "] " & vbCrLf
Else
lb.Text = "[" & i & "] " & vbCrLf
End If
Paginazione.Controls.Add(lb)
Next
End If
End Sub

End Class
e nella pagina
............
<asp:label id="lrisultati" runat="server" font-size="10pt" font-bold="True" font-names="Arial"></asp:label>
..........
<TD vAlign="top" align="center" width="760">
<asp:repeater id="RTeam" runat="server">
<ItemTemplate>
<table width="400">
<tr>
<td width="160" vAlign="top" height="150" align="left">[img]<%#Container.DataItem("UrlFoto")%>[/img]</td>
<td width="240" vAlign="top" height="150">
<div class="cap" align="justify"><%#Container.DataItem("Nome")%></div>
<div class="txtr" align="justify"><%#Container.DataItem("incarico")% ></div>
</td>
</tr>
</table>
</ItemTemplate>
<AlternatingItemTemplate>
<table width="400">
<tr>
<td width="240" vAlign="top" height="150">
<div class="cap" align="justify"><%#Container.DataItem("Nome")%></div>
<div class="txtr" align="justify"><%#Container.DataItem("incarico")% ></div>
</td>
<td width="160" vAlign="top" height="150" align="right">[img]<%#Container.DataItem("UrlFoto")%>[/img]</td>
</tr>
</table>
</AlternatingItemTemplate>
</asp:repeater>
<asplaceholder ID="Paginazione" runat="server" />
</TD>
............
se potete aiutarmi a risolvere la questione...
grazie,
Elisa