Source Code

for file ~/S03_AJAXControls/TableData.aspx

<%@ Page Language="C#" %>
<%
  // TableData.aspx
  // Sample page to show the AJAX enabled TableData Control.
  // Copyright (c) by Matthias Hertel, http://www.mathertel.de
  // This work is licensed under a BSD style license. See http://www.mathertel.de/License.aspx
  // ----- 
  // 01.06.2005 created by Matthias Hertel
  // 29.09.2005 namespaces rearranged.
  // 06.11.2005 cols attribute added.
  // 13.11.2005 service attribute added, fetching all visible rows at a time.
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">
  <title>Table Data</title>
  <link href="../mathertel.css" rel="stylesheet" type="text/css" />
  <script type="text/javascript" src="../ajaxcore/ajax.js"></script>
  <script type="text/javascript" src="../ajaxcore/GetJavaScriptProxy.aspx?service=../S03_AJAXControls/TableData.asmx"></script>
</head>

<body>
  <mh:Title ID="Title" runat="server" />
  <a href="../ViewSrc.aspx" style="position: absolute; right: 10px; top: 10px">View
    Source</a>
  <p>This is a sample how to populate a table or grid with data dynamicaly by calling a web service at the time a row gets visible.</p>
  <ol>
  <li>click a button to fetch data in a specified order.</li>
  <li>click on the (all) button.</li>
  <li>scroll down the table and see the rows get filled.</li>
  </ol>
  <div>
    <button onclick="document.getElementById('TableDataPager33').Select('', 'none')">Select all unsorted</button>
    <button onclick="document.getElementById('TableDataPager33').Select('', 'company')">Select all by company</button>
    <button onclick="document.getElementById('TableDataPager33').Select('', 'name')">Select all by name</button>
    <button onclick="document.getElementById('TableDataPager33').Clear()">Clear</button>
    <ajax:TableDataPager ID="TableDataPager33" runat="server" 
     Service="TableData"
     tabledatapart="tab44" Pagesize="20" showall="true" />
    <ajax:TableData ID="tab44" cols="company[Company];name[Name]:200;city[City]:100;country[Country]:100"
    runat="server" />
  </div>
  <mh:Footer ID="foot" runat="server" />
</body>

</html>


This page is part of the http://www.mathertel.de/AJAXEngine/default.aspx project. For updates and discussions see The AJAX Engine blog.

For updates and discussions see http://ajaxaspects.blogspot.com/.