This paging system or Pagination includes Columning with ASP.NET VB version. If your ASP.NET website has many records, use this code. Allow you to page through your records effortlessly.
Live Lessons Example - ASP.NET Column & Paging System with VB.NET

I needed assistance in getting this code to work like the original Classic ASP projects, so I went to ASPForums.net«
The original code for this project was taken from ASPSnippets.com«.
  1. Display your records in Columns
  2. Page through your records instead of displaying them on the same page.
This code does it all in one simple, easy-to-use script.
Customize the CSS code to suit your page.
Dated: July 5, 2026
The paging system was found online in 2010 and eventually reached the original CFF Coding Source site on July 12, 2012.
[CSS - Load.css]
CFFCS | CarrzSynEdit: | CSS (Cascading Style Sheets)
/* Card Container */
.form-card (
  max-width: 500px;
  background: #ffffff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  font-family: 'Segoe UI', system-ui, sans-serif;
  margin: 20px auto;
)

/* Grouping and Labels */
.input-group ( margin-bottom: 20px; )

.field-label (
  display: block;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 2px;
)

.field-hint (
  display: block;
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 8px;
)

/* Inputs */
.styled-input (
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-sizing: border-box; /* Prevents overflow */
  transition: border-color 0.2s;
)

.styled-input:focus (
  outline: none;
  border-color: #6366f1;
  ring: 2px solid #e0e7ff;
)

/* Custom File Button */
.file-input-custom::file-selector-button (
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  margin-right: 10px;
)

/* Submit Button */
.submit-btn (
  width: 100%;
  background: #6366f1;
  color: white;
  padding: 12px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
)

.submit-btn:hover ( background: #4f46e5; )

[ASP.NET - Load.aspx]
CFFCS | CarrzSynEdit: | ASP.NET (VB/C#)
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Load.aspx.vb" Inherits="Load" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>ASP.NET Column & Paging System with VB.NET</title></head>
<link rel="stylesheet" href="Load.css">
<body>
    <form id="form1" runat="server">
<asp:DataList ID="dlCustomers" runat="server" RepeatDirection="Horizontal" RepeatColumns="5">

<ItemTemplate>

<table cellpadding="2" cellspacing="0" class="Item">
    <tr>
        <td class="body">
            <%# Eval("MyTitle") %>

        </td>
    </tr>
</table>
</ItemTemplate>
</asp:DataList>

<asp:Repeater ID="rptPager" runat="server">
    <ItemTemplate>
        <asp:LinkButton ID="lnkPage" runat="server" Text='<%#Eval("Text") %>' CommandArgument='<%# Eval("Value") %>'
            CssClass='<%# If(Convert.ToBoolean(Eval("Enabled")), "page enabled", "page disabled")%>'
            OnClick="Page Changed" OnClientClick='<%# If(Not Convert.ToBoolean(Eval("Enabled")), "return false;", "") %>'></asp:LinkButton>
    </ItemTemplate>
</asp:Repeater>
        

        [<asp:Label ID="CurrentPageNumber" runat="server" Font-Bold="true" />]
    </form>
</body>
</html>

[ASP.NET - Load.aspx.vb]
CFFCS | CarrzSynEdit: | ASP.NET (VB/C#)
Imports System.Data
Imports System.Configuration
Imports System.Data.SqlClient
Imports System.Collections.Generic
Partial Class Load
    Inherits System.Web.UI.Page
    Private PageSizes As Integer = 100

    Protected Sub Page Load(sender As Object, e As EventArgs) Handles Me.Load
        If Not IsPostBack Then
            Me.GetCustomersPageWise(1)
        End If
    End Sub

    Private Sub GetCustomersPageWise(pageIndex As Integer)
        Dim constr As String = ConfigurationManager.ConnectionStrings("Virtual-Learning").ConnectionString
        Using con As New SqlConnection(constr)
            Using cmd As New SqlCommand("GetCustomersPageWise", con)
                cmd.CommandType = CommandType.StoredProcedure
                cmd.Parameters.AddWithValue("@PageIndex", pageIndex)
                cmd.Parameters.AddWithValue("@PageSize", PageSizes)
                cmd.Parameters.Add("@RecordCount", SqlDbType.Int, 4)
                cmd.Parameters("@RecordCount").Direction = ParameterDirection.Output
                con.Open()
                Dim idr As IDataReader = cmd.ExecuteReader()
                dlCustomers.DataSource = idr
                dlCustomers.DataBind()
                idr.Close()
                con.Close()
                Dim recordCount As Integer = Convert.ToInt32(cmd.Parameters("@RecordCount").Value)
                Me.PopulatePager(recordCount, pageIndex)
            End Using
        End Using
    End Sub

    Private Sub PopulatePager(recordCount As Integer, currentPage As Integer)
        Dim dblPageCount As Double = CDbl(CDec(recordCount) / CDec(PageSizes))
        Dim pageCount As Integer = CInt(Math.Ceiling(dblPageCount))
        Dim pages As New List(Of ListItem)()
        If pageCount > 0 Then
            If currentPage > 1 Then
                pages.Add(New ListItem("First", "1"))
            End If
            If currentPage > 1 Then
                pages.Add(New ListItem("Previous", (currentPage - 1).ToString()))
            End If
            For i As Integer = 1 To pageCount
                pages.Add(New ListItem(i.ToString(), i.ToString(), i <> currentPage))
            Next
            If currentPage < pageCount Then
                pages.Add(New ListItem("Next", (currentPage + 1).ToString()))
            End If
            If currentPage <> pageCount Then
                pages.Add(New ListItem("Last", pageCount.ToString()))
            End If
        End If
        rptPager.DataSource = pages
        rptPager.DataBind()
        CurrentPageNumber.Text = String.Format("Showing page (0) of (1):", currentPage, pageCount) & " Total of Records: " & +recordCount
    End Sub

    Protected Sub Page Changed(sender As Object, e As EventArgs)
        Dim pageIndex As Integer = Integer.Parse(TryCast(sender, LinkButton).CommandArgument)
        Me.GetCustomersPageWise(pageIndex)
    End Sub

    Private Property TotalRowCount() As Integer
        Get
            Dim o As Object = ViewState("TotalRowCount")
            If (o Is Nothing) Then
                Return -1
            Else
                Return Convert.ToInt32(o)
            End If
        End Get
        Set(Value As Integer)
            ViewState("TotalRowCount") = Value
        End Set
    End Property


End Class

[ASP.NET - Web.config]
CFFCS | CarrzSynEdit: | ASP.NET (VB/C#)
<?xml version="1.0" encoding="utf-8"?>
<!'
  For more information on how to configure your ASP.NET application, please visit
  https://go.microsoft.com/fwlink/?LinkId=169433
  '>
<configuration>
  <connectionStrings configSource="database.config" />
  <system.web>
    <compilation strict="false" explicit="true" targetFramework="4.7.2" />
    <httpRuntime targetFramework="4.7.2" />
  </system.web>
</configuration>
<!'ProjectGuid: 376b38f6-039f-419b-b832-eae91cd38ed6'>

[ASP.NET - database.config]
CFFCS | CarrzSynEdit: | ASP.NET (VB/C#)
<?xml version="1.0"?>
<connectionStrings>
  <add name="Virtual-Learning" connectionString="Data Source=sqlcorecs-01\sql2019;Database=Virtual-Class-01;User ID=YOURUSERNAME;Password=YOURPASSWORD*;MultipleActiveResultSets=True" />
</connectionStrings>

Other Articles Related to this Entry.