This topic is locked

How to filter data on the list page

10/8/2007 8:39:48 AM
ASPRunnerPro Tips and tricks
admin

Use Insert ASP code snippet function and the following code:

dim rs

FieldName = "Make"

set rs = server.createobject("ADODB.Recordset")

rs.open "Select " & FieldName & " from " & strTableName, dbConnection
Response.Write "<script>" & vbcrlf

Response.Write "function gopage(theLink) { " & vbcrlf

Response.Write "if (document.frmAdmin.theLink.value != '') {" & vbcrlf

Response.Write "location.href = 'cars_list.asp?a=search&value=1&SearchFor=' + document.frmAdmin.theLink.value + '&SearchOption=Equals&SearchField=" & FieldName & "'; } }" & vbcrlf

Response.Write "</script>" & vbcrlf
Response.Write "<select name='theLink' onchange='gopage(this)'>" & vbcrlf

Response.Write "<option selected value=''></option>" & vbcrlf


while not rs.eof

Response.Write "<option value='" & rs(FieldName)& "'>" & rs(FieldName)& "</option>" & vbcrlf

rs.MoveNext

wend

Response.Write "</select>"
S
seaninsjca 4/24/2008

If I do this on the list page I get an error.

  1. load _*** List page
  2. click "Insert ASP Code Snippet"
  3. copy and paste code from this post over 'Put your code here. (do I overwrite the original Response.Write "Your message"?)
  4. rebuild
  5. error
    Microsoft VBScript compilation error '800a0408'
    Invalid character
    /include/_techrecord_events.asp, line 39
    Sub _techrecord_Event1()

    -----^
  6. line 39 is "Sub _techrecord_Event1()"
    What am I doing wrong?
    Thanks!
    Use Insert ASP code snippet function and the following code:



dim rs

FieldName = "Make"

set rs = server.createobject("ADODB.Recordset")

rs.open "Select " & FieldName & " from " & strTableName, dbConnection
Response.Write "&lt;script>" & vbcrlf

Response.Write "function gopage(theLink) { " & vbcrlf

Response.Write "if (document.frmAdmin.theLink.value != '') {" & vbcrlf

Response.Write "location.href = 'cars_list.asp?a=search&value=1&SearchFor=' + document.frmAdmin.theLink.value + '&SearchOption=Equals&SearchField=" & FieldName & "'; } }" & vbcrlf

Response.Write "</script>" & vbcrlf
Response.Write "<select name='theLink' onchange='gopage(this)'>" & vbcrlf

Response.Write "<option selected value=''></option>" & vbcrlf
while not rs.eof

Response.Write "<option value='" & rs(FieldName)& "'>" & rs(FieldName)& "</option>" & vbcrlf

rs.MoveNext

wend

Response.Write "</select>"
admin 4/24/2008

Remove the leading underscore character from event name.

A
agruspe 5/20/2008

On the sample code, this applies to the MAKE field column only. Can you show another sample code that will do multiple column.

A
aspcheck 12/16/2008

Sergey,
I tried this and it did not work. Could you please assist me?
Once I select the field on the main list.asp page, I get let us say 5,000 rows and I would like to filter that results set using column filters like Excel.
Any suggestions?
Thanks.
John

admin 12/17/2008

John,
you can post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your demo account URL.