Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
asp sort table columns show errors - please help
Old 02-25-2009, 10:35 AM asp sort table columns show errors - please help
tadisaus2's Avatar
Skilled Talker

Posts: 89
Trades: 0
Hello,
I am trying to sort table columns but it kept generating the errors by showing the black page when I click on the column's names to sort.
When I clicked on "Cars", it showed black page (not found) and the url is like this:
default?sortby=Cars&Cars=&sortOrder=asc&alpha=
And the error page is:
The page cannot be found
The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.

Can anyone please tell me how to fix it?
Thank you very much!
Code:
<%  
Dim sAlpha, Cars, DateShippedSold, DateSubmitted
Dim sortOrder: sortOrder = request.querystring("sortOrder")
    Dim sortby: sortby = request.querystring("sortby")
    select case sortOrder
        case "asc"
           sortOrder = "desc"
        case "desc"
            sortOrder = "asc"
        case else
            sortOrder = "asc"
    end select
Set oRs=Server.CreateObject("adodb.recordset")
    strSQL = "SELECT ID, Cars, DateShippedSold, DateSubmitted " & _
   " FROM tblCars "
If (len(sAlpha) > 0) Then _
    strsql = strsql  & " where "&sortby&" like '"&sAlpha&"%'"
if len(sortby) > 0 then _
    strsql = strsql  & " order by "&sortby&" " & sortOrder
    oRs.Open strSQL, myConn
%>
<table>
 <tr>
  <td><a href="default?sortby=Cars&Cars=<%=Cars%>&sortOrder=<%=sortOrder%>&alpha=<%=sAlpha%>">Cars</a><% if (sortby = "Cars") then response.write "<span style=""color:red;"">*</span>" end if %></td>
  <th><a href="default?sortby=Shipped&Shipped=<%=DateShippedSold%>&sortOrder=<%=sortOrder%>&alpha=<%=sAlpha%>">Shipped</a><% if (sortby = "Shipped") then response.write "<span style=""color:red;"">*</span>" end if %></th>
  <th><a href="default?sortby=Submitted&Submitted=<%=DateSubmitted%>&sortOrder=<%=sortOrder%>&alpha=<%=sAlpha%>">Submitted</a><% if (sortby = "Submitted") then response.write "<span style=""color:red;"">*</span>" end if %></th>
 </tr>
<% While Not oRs.EOF %>
<tbody id="offTblBdy">
 <tr>
  <td><a href="detail.asp?ID=<%=oRs("ID")%>"><%=oRs("Cars")%></a></td>
  <td><%=oRs("DateShippedSold")%></td>
  <td><%=oRs("DateSubmitted")%></td>
 </tr>
<% 
oRs.MoveNext
 WEND
%>
tadisaus2 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-25-2009, 01:54 PM Re: asp sort table columns show errors - please help
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,516
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
and do you have a page called "default"?
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to asp sort table columns show errors - please help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.38486 seconds with 12 queries