ASP PageMinder
Demo 3 - Fully customisable style, layout and graphics
<%
' declare the variables used on this page
Dim pm
' create an instance of the PageMinder object
Set pm = Server.CreateObject ("ASPaxis.PageMinder")
pm.SetPageRows = 10 ' set a default number of rows to display per page
pm.SetConnection = CONN_SQLSERVER ' db connection string and SQL command
pm.SetSource = "SELECT Region, WineName, Vintage, CostPerBottle, ImagePath FROM WineList"
pm.SetPageBar_PageGroupMultiple = 10 ' sets the page bar numbering to accomodate large recordsets
pm.SetSortColumnDefault = "WineName, Region, Vintage" ' sets sort defaults
pm.SetSortColumnDefaultDirection = "asc, asc, asc"
pm.SetSortDepth = 3 ' sets sort depth
pm.SetUrlRowsText = "" ' disables interactive row number setting
' setting the session allows PageMinder to remember the page and sort
' info without any url parameters
pm.SetSession = "pm01"
' uses the Aspect and Look objects to define text and image elements and attributes
' including javascript rollover functions and additional attributes
With pm.Aspect
.SetPageBar_PageNumberSpacer.Image = "/images/square-dot.gif"
.SetPageBar_PageNumberSpacer.ImgAttributes = "vspace=""5"" hspace=""5"""
.SetPageBar_PageGroupNumberSpacer.Image = "/images/square-dot.gif"
.SetPageBar_PageGroupNumberSpacer.ImgAttributes = "vspace=""5"" hspace=""5"""
.SetPageBar_PageGroupNumber.Text = "*1-*2"
.SetPageBar_FirstIcon.Image = "/images/arrows/arrow_first.gif"
.SetPageBar_FirstIcon.MouseOverImage = "/images/arrows/arrow_first_over.gif"
.SetPageBar_FirstIcon.ImgAttributes = "vspace=""5"" hspace=""2"""
.SetPageBar_LastIcon.Image = "/images/arrows/arrow_last.gif"
.SetPageBar_LastIcon.MouseOverImage = "/images/arrows/arrow_last_over.gif"
.SetPageBar_LastIcon.ImgAttributes = "vspace=""5"" hspace=""2"""
.SetPageBar_PrevIcon.Image = "/images/arrows/arrow_prev.gif"
.SetPageBar_PrevIcon.MouseOverImage = "/images/arrows/arrow_prev_over.gif"
.SetPageBar_PrevIcon.ImgAttributes = "vspace=""5"" hspace=""2"""
.SetPageBar_NextIcon.Image = "/images/arrows/arrow_next.gif"
.SetPageBar_NextIcon.MouseOverImage = "/images/arrows/arrow_next_over.gif"
.SetPageBar_NextIcon.ImgAttributes = "vspace=""5"" hspace=""2"""
.SetHeading_ArrowUp.ImgAttributes = "border=""0"""
.SetHeading_ArrowDown.ImgAttributes = "border=""0"""
.SetPagebar_FirstSpacer.Text = ""
.SetPagebar_LastSpacer.Text = ""
.SetPagebar_PrevSpacer.Text = ""
.SetPagebar_NextSpacer.Text = ""
End With
pm.SetPageBar_PrevNextAlwaysShow = true
pm.SetPageBar_FirstLastAlwaysShow = true
pm.Cycler_Add "alternate", 1, "", "", " class=""altrow"""
%>
<head>
<% ' Javascript for preloading rollover images %>
<%= pm.Aspect.CreateJavaScript() %>
</head>
<table cellspacing="0" summary="Winelist data">
<% If (pm.InitRS = true) then %>
<tr>
<td colspan="4"><div class="records">Wines <%= pm.CurrentPageFirstItem %> to <%= pm.CurrentPageLastItem %> of <%= pm.RecordsetTotalItems %></div></td>
</tr>
<tr>
<td colspan="4"><div class="pagebar"><%= pm.CreatePageBar_All %></div></td>
</tr>
<tr>
<th><%= pm.CreateHeading ("Region", "Region", True, "Asc") %></th>
<th><%= pm.CreateHeading ("WineName", "Name", True, "Asc") %></th>
<th><%= pm.CreateHeading ("Vintage", "Vintage", True, "Asc") %></th>
<th><%= pm.CreateHeading ("CostPerBottle", "Price", True, "Asc") %></th>
</tr>
<% Do %>
<tr<%= pm.Cycler_GetString ("alternate") %>>
<td class="col1"><%= pm.GetItem ("Region") %></td>
<td class="col2"><%= pm.GetItem ("WineName") %></td>
<td class="col3"><%= pm.GetItem ("Vintage") %></td>
<td class="col4"><%= ShowCurrency (pm.GetItem ("CostPerBottle")) %></td>
</tr>
<%
pm.MoveNextItem
Loop Until pm.CurrentPageRowEnd
%>
<tr>
<td colspan="4"><div class="border"><div class="pagebar"><%= pm.CreatePageBar_All %></div></div></td>
</tr>
<%
Set pm = Nothing
End If
%>
</table>
...HTML...