Dispaly table data in ajax table

Posted on 2009-04-03
Last Modified: 2012-05-06
I want to pull all the data from the table annd be able to sort it with AJAX based on column title. THis is a classic asp page.

Columne names:
ID, firstName, lastName, emailAdd, title, company, ipAddress, phone, country, interestedIn, comments, dateSubmitted, duplicate, completed
<div class="display">

<table cellpadding="5" cellspacing="0">


<td class="header">ID</td> 

<td class="header">First Name</td> 

<td class="header">Last Name</td> 

<td class="header">Email</td> 

<td class="header">Title</td> 

<td class="header">Company</td> 

<td class="header">ipAddress</td> 

<td class="header">Phone</td> 

<td class="header">Country</td> 

<td class="header">Interested IN</td> 

<td class="header">Comments</td> 

<td class="header">Date Submitted</td> 

<td class="header">Dup</td> 

<td class="header">Comp</td>



dim blnOdd

blnOdd = True

 count = Request("count")

 On Error Resume Next


 do while Not objRS.eof

 If blnOdd Then 

        theColor = "#ffffff" 


        theColor = "#dedede" 

 End If

 blnOdd = not blnOdd



<td  bgcolor="<%=theColor%>"><% Response.Write objRS("ID") %></td>

<td bgcolor="<%=theColor%>"><% Response.Write objRS("firstName") %></td>

<td bgcolor="<%=theColor%>"><% Response.Write objRS("lastName") %></td>

<td bgcolor="<%=theColor%>"><% Response.Write objRS("emailAdd") %></td>

<td bgcolor="<%=theColor%>"><% Response.Write objRS("title") %></td>

<td bgcolor="<%=theColor%>"><% Response.Write objRS("company") %></td>

<td bgcolor="<%=theColor%>"><% Response.Write objRS("ipAddress") %></td>

<td bgcolor="<%=theColor%>" nowrap><% Response.Write objRS("phone") %></td>

<td bgcolor="<%=theColor%>"><% Response.Write objRS("country") %></td>

<td bgcolor="<%=theColor%>"><% Response.Write objRS("interestedIn") %></td>

<td bgcolor="<%=theColor%>"><% Response.Write objRS("comments") %></td>

<td bgcolor="<%=theColor%>"><% Response.Write objRS("dateSubmitted") %></td>

<td bgcolor="<%=theColor%>"><% IF objRS("duplicate")=1 Then%>Yes<%ELSE%> <%END IF%></td>

<td bgcolor="<%=theColor%>"><% IF objRS("completed")=1 Then%>Yes<%ELSE%> <%END IF%></td>










Set objRS = Nothing


Set objConn = Nothing


Open in new window

Question by:pGustafson

Accepted Solution

mahadevan_v earned 500 total points
ID: 24068412
This is exactly what you want.. check it

you can send a parameter to the select query for sorting based on the column selected
set the attribute in the cells of header row .. pass it to query and return the complete html table

Happy coding :)

Author Closing Comment

ID: 31566303
Thank you very much!

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
This video discusses moving either the default database or any database to a new volume.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now