This topic is locked

Default filter on list page (v4.1)

3/15/2007 4:19:54 AM
ASPRunnerPro General questions
A
abdemir author

Hi,
I use following code for default filter on the list page with ASP Runner version 4.0, however I couldn't find ORIGINAL CODE section in ASP Runner 4.1, I think it's different.
May you give new code for version 4.1
Best Regards,

Bulent
ORIGINAL CODE (v4.0)

---------------------------

if Request("action")="" then

strSQL = AddWhere(strSQL, "1=0")

end if
CHANGED CODE (v4.0)

---------------------------

if Request("action")="" then

strSQL = AddWhere(strSQL, "status = 'open'")

end if

J
Jane 3/15/2007

Hi,
you need to find following code:

if (Request.Form="" and Request.QueryString="") then strSQL = AddWhere(strSQL,"1=0")

and replace it with this one:

if (Request.Form="" and Request.QueryString="") then strSQL = AddWhere(strSQL,"status = 'open'")

A
abdemir author 3/15/2007

Hi Jane,
I couldn't see
if (Request.Form="" and Request.QueryString="") then strSQL = AddWhere(strSQL,"1=0")
code in ...list.asp
Original Code

----------------

if (Request.Form="" and Request.QueryString="") then
For Each key in Session.Contents

if left(key, len(strTableName)+1 ) = strTableName & "
" and

InStr(Mid(key, len(strTableName)+2), "
" )<1 then

Session.Contents.Remove(key)

end if

Next
set strTableName_asearchnot = CreateObject("Scripting.Dictionary")

set strTableName_asearchopt = CreateObject("Scripting.Dictionary")

set strTableName_asearchfor = CreateObject("Scripting.Dictionary")

set strTableName_asearchfortype = CreateObject("Scripting.Dictionary")

set strTableName_asearchfor2 = CreateObject("Scripting.Dictionary")

set session(strTableName & "_asearchnot")= strTableName_asearchnot

set session(strTableName & "_asearchopt") = strTableName_asearchopt

set session(strTableName & "_asearchfor") = strTableName_asearchfor

set session(strTableName & "_asearchfor2") = strTableName_asearchfor2

set session(strTableName & "_asearchfortype") = strTableName_asearchfortype

end if

J
Jane 3/15/2007

You need to check off No records on the first page option on the Edit SQL query tab, build your project, then open ..._list.asp file and make your changes.

A
abdemir author 3/15/2007

Thank you, its solved