Click here to Skip to main content
13,253,212 members (49,834 online)
Click here to Skip to main content
Articles » Web Development » ASP.NET » Data » Downloads


29 bookmarked
Posted 20 Jun 2005

Generic Paging for Recordset with Next Back Navigation

, 20 Jun 2005
This article is basically about a Paging control required for project purposes. One can use this just by changing three parameters.
<%@ OutputCache Duration=3 Location="Client" VaryByCustom="browser VaryByParam="None"%>
<%@ Page language="c#" Codebehind="PagingWithData.aspx.cs" AutoEventWireup="false" Inherits="Paging.WebForm3" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
		<LINK href="../styles/styles.css" rel="STYLESHEET" type="text/css">
		<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
		<meta name="CODE_LANGUAGE" Content="C#">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="">
		<script language="JavaScript">
		function addDays(myDate,days) 
			//return new Date(myDate.getTime() + days*24*60*60*1000);
			return myDate;
		function OpenNewWin()
			alert("Open Window PleaseS");'Basic.aspx','Asset','width=350,height=400,left=270,top=180,scrollbars=yes');
			return true;
	<body MS_POSITIONING="GridLayout">
		<form id="Form1" method="post" runat="server">
			<TABLE id="Table2" style="Z-INDEX: 101; LEFT: 96px; WIDTH: 312px; POSITION: absolute; TOP: 72px; HEIGHT: 224px"
				cellSpacing="1" cellPadding="1" width="312" border="1">
					<TD style="WIDTH: 110px"><STRONG>Total Record</STRONG></TD>
					<TD style="WIDTH: 63px">&nbsp;<STRONG>Select</STRONG></TD>
					<TD style="WIDTH: 256px">
						<asp:DropDownList id="ddlTotalRec" runat="server" Width="216px" AutoPostBack="True">
							<asp:ListItem Value="100">SELECT CustomerID, CompanyName FROM Customers</asp:ListItem>
							<asp:ListItem Value="200">Select CategoryID,CategoryName from Categories</asp:ListItem>
							<asp:ListItem Value="300">Select EmployeeID,LastName from Employees</asp:ListItem>
					<TD style="WIDTH: 34px">&nbsp;</TD>
					<TD style="WIDTH: 110px"><STRONG>Records</STRONG></TD>
					<TD style="WIDTH: 63px"><STRONG>&nbsp;Table</STRONG></TD>
					<TD style="WIDTH: 256px">
						<asp:Table id="tblRecordset" runat="server"></asp:Table></TD>
					<TD style="WIDTH: 34px">&nbsp;</TD>
					<TD>&nbsp;<STRONG>&nbsp;&nbsp;</STRONG> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
					<TD style="WIDTH: 110px; HEIGHT: 42px">&nbsp;&nbsp;
						<asp:Button id="btnFirstRec" runat="server" Text="<"></asp:Button></TD>
					<TD style="WIDTH: 63px; HEIGHT: 42px">&nbsp;&nbsp;
						<asp:Button id="btnPrev" runat="server" Text="<<"></asp:Button>
					<TD style="WIDTH: 256px; HEIGHT: 42px">
						<asp:Table id="tblPaging" runat="server" cellspacing="0" Runat="server"></asp:Table></TD>
					<TD style="WIDTH: 34px; HEIGHT: 42px">&nbsp;&nbsp;
						<asp:Button id="btnNext" runat="server" Text=">>"></asp:Button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<TD style="HEIGHT: 42px">&nbsp;
						<asp:Button id="btnLastRec" runat="server" Text=">"></asp:Button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
					<TD style="WIDTH: 110px"><STRONG>First</STRONG></TD>
					<TD style="WIDTH: 63px"><STRONG>Previous</STRONG></TD>
					<TD style="WIDTH: 256px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<STRONG>Pagination</STRONG></TD>
					<TD style="WIDTH: 34px"><STRONG>Next</STRONG></TD>
			<asp:Label id="Label3" style="Z-INDEX: 102; LEFT: 264px; POSITION: absolute; TOP: 16px" runat="server"
				Width="329px" Font-Bold="True">Paging With Intervals</asp:Label>
			<asp:Label id="Label1" style="Z-INDEX: 104; LEFT: 96px; POSITION: absolute; TOP: 48px" runat="server"
				Width="214px" Height="7px">Label</asp:Label>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

santosh poojari
Technical Lead
Australia Australia
Whatsup-->Exploring--> MVC/HTML5/Javascript & Virtualization.......!

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.171114.1 | Last Updated 21 Jun 2005
Article Copyright 2005 by santosh poojari
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid