Source Code

for file /AJAXEngine/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>
<html lang="en">

<head runat="server">
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <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=/AJAXEngine/S03_AJAXControls/TableData.asmx"></script>
</head>

<body>
  <mh:Banner ID="Banner1" runat="server" />
  <mh:Title ID="Title" runat="server" />
  <a style="position: absolute; right: 32px; top: 10px" href="../ViewSrc.aspx">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/ web site.

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