Click here to Skip to main content
11,484,752 members (64,559 online)
Click here to Skip to main content
Add your own
alternative version

AJAX Demystified - Part Two - The AJAX DataGrid

, 21 Jun 2007 CPOL 61.3K 607 81
Create an AJAX DataGrid that binds, sorts and pages with no post-backs
<%@ Page language="c#" Codebehind="ajaxDatagrid.aspx.cs" AutoEventWireup="false" Inherits="ajaxDG.ajaxDatagrid" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
		<title>AJAX Powered DataGrid</title>
		<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" type="text/javascript" src="ajaxDatagrid.js"></script>
		<style type="text/css"> @import url( ajaxDatagrid.css );  </style>
	<body MS_POSITIONING="GridLayout">
		<form id="frmDatagrid" method="post" runat="server">
			<table id="tblMain" align="center">
					<td align="center">Query:<INPUT type="text" size="80" id="txtQuery" value="SELECT * FROM CUSTOMERS">&nbsp;Rows:
						<INPUT id="txtRows" type="text" size="2" value="20" name="txtRows">&nbsp;<INPUT id="btnQuery" type="button" value="Query" onclick="pageGrid(1)"></td>
					<td><div id="results"></div>
					<td><INPUT id="txtSort" type="hidden" name="txtSort">
					<INPUT id="txtPage" type="hidden" name="txtPage"></td>

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

United States United States
I have been an ASP.NET/C# Programmer/Software Architect for about 10 years, specializing in web architecture, user interface, and user experience. I formerly wrote business applications for mortgage banking front-ends in C++ before switching to the .NET Framework many years ago, and I've never looked back. I'm an evangelist of HTML5 and web standards, and spend the majority of my time working on front end design, performance and scale.

My primary website is located at

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150520.1 | Last Updated 21 Jun 2007
Article Copyright 2006 by UsualDosage
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid