DHTML Paging Demo

This demo illustrates how to page database results using client-side DHTML code. Take a moment to do a View/Source in your browser to see the complete client-side code. This FAQ lists the 25 most popular FAQs from ASPFAQs.com.

Netscape Issues
A number of people have reported having problems with Netscape 4.x browsers in viewing this demo. If you have Netscape 5.0 or greater and have problems, please do let me know. I have to admit that I am no Netscape expert; I don't even have it installed on my computer. So, you're at your own on getting this to work with Netscape 4.x. Sorry... (If you have gotten it to work, or know the code needed, do let me know, and I'll update the dhtmlGetRows class!)


Most Popular FAQs at ASPFAQs.com

 


Source Code
<!--#include file="dhtmlGetRows.class.asp"-->
<%
 'Create and populate a Recordset
 Dim objRS, objConn, strSQL
 Set objConn = Server.CreateObject("ADODB.Connection")
 objConn.Open "DSN=MyDSN"
 
 strSQL = "SELECT TOP 25 ViewCount, Description " & _
          "FROM tblFAQ ORDER BY ViewCount DESC"
 
 Set objRS = objConn.Execute(strSQL)
 
 'Create an instance of the dhtmlGetRows class
 Dim objPagedResults
 Set objPagedResults = new dhtmlGetRows
 
 objPagedResults.THString = "<th>Views</th><th>FAQ Question</th>"
 Response.Write objPagedResults.GenerateHTML(objRS)
 
 'Clean up...
 Set objPagedResults = Nothing
  
 objRS.Close
 Set objRS = Nothing
 
 objConn.Close
 Set objConn = Nothing
%>

The above code snippet assumes that the dhtmlGetRows class is available in a server-side include file dhtmlGetRows.class.asp. To learn more about server-side includes be sure to read: The Low-Down on #include.


[Return to the article] | [Download the code for the dhtmlGetRows class]