Home
About
Contact
Categories
Classic ASP (28 - Sub-Categories)
CSS (1 - Sub-Category)
JavaScript (4 - Sub-Categories)
Databases (22 - Sub-Categories)
ASP.NET (23 - Sub-Categories)
Delphi (5 - Sub-Categories)
Windows Server Core (3 - Sub-Categories)
VMWare (1 - Sub-Category)
Code Editing Tools (2 - Sub-Categories)
Linux (2 - Sub-Categories)
Dell Servers (15 - Sub-Categories)
Bug Reports
(Bugs Fixed
New CFFCS Coding Source is still in Beta
Please report any errors to the [Contact] page. Thank you.
Classic ASP (28)
CSS (1)
JavaScript (4)
Databases (22)
ASP.NET (23)
Delphi (5)
Windows Server Core (3)
VMWare (1)
Code Editing Tools (2)
Linux (2)
Dell Servers (15)
Resources
[View The Source Code For This Project]
Format SQL Script
ASP.NET
VB.NET
ASP.NET Column & Paging System with VB.NET
HTML
<%# Eval("MyTitle") %>
[
]
CSS
body { font-family: Arial; font-size: 10pt; } .Item { height: 5px; width: 100%; /*Get the length of the longest word then duplicate for that column only.*/ margin: 0; } .Item, .Item td, .Item td { border: 1px solid #ccc; } .Item .header { color: Black; font-size: 10pt; line-height: 200%; } .page_disabled{ border: 1px double #000; background-color: #036; color: #FFF; padding: 4.5px; /*Make the selected number container larger then those around it.*/ font-size: 10pt; } .page_enabled, .page_disabled { display: inline-block; height: 25px; min-width: 25px; line-height: 25px; text-align: center; text-decoration: none; border: 1px solid #ccc; } .page_enabled { color: #000; } .page_disabled { color: #fff !important; }
SQL
Create Table and Generate Records
Stored Procedure
USE [Virtual-Class-01] GO /****** Object: Table [dbo].[Paging] Script Date: 9/19/2022 8:01:13 PM ******/ /*This is the shortlist, only 100 records instead of the giant list of 1,298 records.*/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Paging]( [ID] [int] IDENTITY(1,1) NOT NULL, [MyTitle] [nvarchar](50) NOT NULL, CONSTRAINT [PK_Paging] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] GO SET IDENTITY_INSERT [dbo].[Paging] ON GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (1, N'MyTitles') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (2, N'Cycle') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (3, N'dame') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (4, N'Ethiopian') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (5, N'language') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (6, N'doomy') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (7, N'Smirk') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (8, N'unbacked') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (9, N'Vitrifacture') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (10, N'pellagra') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (11, N'Dunkirk') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (12, N'Smatch') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (13, N'interproximal') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (14, N'figurer') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (15, N'or38') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (16, N'texan') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (17, N'mispronunciation') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (18, N'shaddock') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (19, N'samiel') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (20, N'ascendable') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (21, N'Rushed') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (22, N'Cucumis') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (23, N'raccoon') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (24, N'dog') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (25, N'Sickleman') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (26, N'nt') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (27, N'Alabaster') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (28, N'pliant') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (29, N'photographer') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (30, N'Crotaphytus') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (31, N'venenosum') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (32, N'suborder') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (33, N'Passeres') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (34, N'prat') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (35, N'icing') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (36, N'sugar') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (37, N'across') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (38, N'Cant') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (39, N'cloud') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (40, N'forest') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (41, N'chigger') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (42, N'flower') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (43, N'unequivocally') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (44, N'To') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (45, N'blow') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (46, N'upon') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (47, N'off-hour') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (48, N'dies') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (49, N'irae') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (50, N'Melanism') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (51, N'claystone') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (52, N'Pearl') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (53, N'travelled') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (54, N'drinking') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (55, N'Bush') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (56, N'bean') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (57, N'63f') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (58, N'Goll') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (59, N'elemi') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (60, N'stonewalling') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (61, N'Signora') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (62, N'nepalese') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (63, N'Balaton') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (64, N'burn') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (65, N'mark') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (66, N'Ni-resist') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (67, N'Unworthy') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (68, N'distressing') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (69, N'Kraut') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (70, N'occidental') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (71, N'wall-paperer') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (72, N'VCR') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (73, N'ls') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (74, N'subalpine') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (75, N'fir') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (76, N'override') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (77, N'Nephridia') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (78, N'populate') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (79, N'Camphene') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (80, N'autofocus') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (81, N'fellfare') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (82, N'forces') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (83, N'obelize') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (84, N'Saltier') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (85, N'hoosac') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (86, N'mountain') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (87, N'lick') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (88, N'decembrist') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (89, N'refractively') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (90, N'underwool') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (91, N'Cyclopteridae') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (92, N'Haggada') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (93, N'Wrap') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (94, N'goal') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (95, N'line') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (96, N'polo,') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (97, N'marco') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (98, N'hame') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (99, N'gramme') GO INSERT [dbo].[Paging] ([ID], [MyTitle]) VALUES (100, N'sea') GO SET IDENTITY_INSERT [dbo].[Paging] OFF GO
SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ============================================= CREATE PROCEDURE [dbo].[GetCustomersPageWise] @PageIndex INT = 1 ,@PageSize INT = 10 ,@RecordCount INT OUTPUT AS BEGIN SET NOCOUNT ON; SELECT ROW_NUMBER() OVER ( ORDER BY [ID] ASC )AS RowNumber ,[ID] ,[MyTitle] INTO #Results FROM [Paging] SELECT @RecordCount = COUNT(*) FROM #Results SELECT * FROM #Results WHERE RowNumber BETWEEN(@PageIndex -1) * @PageSize + 1 AND(((@PageIndex -1) * @PageSize + 1) + @PageSize) - 1 DROP TABLE #Results END
ASP.NET
Web.Config
database.Config
Load.aspx.vb
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
Preview
Tags
paging system includes Columning with ASP.NET
ASP.NET website
Allow you to page through your records effortlessly
ASP.NET Paging
ASP.NET Pagenation
ASP.NET Pagination
VB.NET Paging