ASP PageMinder

Demo 2 - Data columns or tabular display with integral paging

<%

' declare the variables used on this page
Dim pm

' create an instance of the PageMinder object
Set pm = Server.CreateObject ("ASPaxis.PageMinder")
pm.SetSortColumnDefault = "WineName"      ' sets the initial sort order of the recordset (ascending)
pm.SetSortColumnDefaultDirection = "Asc"
pm.SetPageRows = 5                        ' sets initial number of rows per page
pm.SetPageColumns = 3                     ' sets number of columns per page

pm.SetConnection = CONN_SQLSERVER         ' sets the ADO connection and SQL source
pm.SetSource = "SELECT Region, WineName, Vintage, CostPerBottle, ImagePath FROM WineList"

%>
...HTML...
<% If (pm.InitRS = true) then %>

            <div>
              <div>
                Goto <%= pm.CreatePageDropdown %>
              </div>

              <div>
                Rows per page <%= pm.CreateRowsDropdown %>
              </div>

              <div>
                Wines <%= pm.CurrentPageFirstItem %> to <%= pm.CurrentPageLastItem %> of <%= pm.RecordsetTotalItems %>
              </div>
            </div>

            <table>
<% ' start the loop for rows
Do %>
              <tr>
  <% ' start the loop for columns
  Do %>
                <td>
                  <% 
                  ' test to see if there is a record and display appropriate HTML
                  If pm.IsItem = true then %>
                    <img src="<%= pm.GetItem ("ImagePath") %>" width="30" height="100" border="0" alt="<%= pm.GetItem ("WineName") %>" />
                  <% Else %>
                     
                  <% End If %>
                </td>

                <td>
                  <% If pm.IsItem = true then %>
                    <%= pm.GetItem ("WineName") %> (<%= pm.GetItem ("Region") %>)<br />
                    <%= pm.GetItem ("Vintage") %><br />
                    <%= ShowCurrency (pm.GetItem ("CostPerBottle")) %>
                  <% Else %>
                     
                  <% End If %>
                </td>

  <% pm.MoveNextItem 
  Loop Until pm.CurrentPageColumnEnd %>
              </tr>
<%
Loop Until pm.CurrentPageRowEnd 
' destroy the object
set pm = nothing

End If
%>
...HTML...