Posted By

krisdb on 03/09/07


Tagged

ASP


Versions (?)

table sorting


 / Published in: ASP
 

  1. Dim sortOrder: sortOrder = request.querystring("sortOrder")
  2. Dim sortby: sortby = request.querystring("sortby")
  3.  
  4. select case sortOrder
  5. case "asc"
  6. sortOrder = "desc"
  7. case "desc"
  8. sortOrder = "asc"
  9. case else
  10. sortOrder = "asc"
  11. end select
  12.  
  13. strsql = "select from table "
  14.  
  15. If (len(sAlpha) > 0) Then _
  16. strsql = strsql & " where "&sortby&" like '"&sAlpha&"%'"
  17.  
  18. if len(sortby) > 0 then _
  19. strsql = strsql & " order by "&sortby&" " & sortOrder
  20.  
  21.  
  22. <a href="<%=scriptName%>?sortby=email&user=<%=user%>&sortOrder=<%=sortOrder%>&alpha=<%=sAlpha%>&start=<%=iStart%>">Email Address</a> <% if (sortby = "email") then response.write "<span style=""color:red;"">*</span>" end if %>

Report this snippet  

You need to login to post a comment.