This topic is locked

Default filter on list page

7/31/2006 10:10:05 AM
ASPRunnerPro General questions
A
abdemir author

Hi,
How can I apply default filter or show special records on list view after page load.
Best Regards,

Bulent
Sample

-----

I want to see only open sales records on list page when page load.
table

----------

id

company

date

price

status

Pfeiffer 7/31/2006

hi,
the simple way is to define a view which includes the filter condition.

Take this view as your table definition...
Uwe Pfeiffer

A
abdemir author 8/1/2006

Hi Uwe,
I can apply the filter on list page with step 4 of 12, its no problem.
But, I want to show only which record is open (status = 'open') and I also want to show all records after click 'show all records' button on list view page.
Could you give sample code please?
Best Regards,

Bulent

Alexey admin 8/1/2006

Bulent,
here is what you can do.

Proceed to Edit SQL query tab in ASPRunner and check off No records on the first page box.
Build the pages.

Open generated ..._list.asp file with a text editor and locate this snippet there:

if Request("action")="" then

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

end if



and replace it with:

if Request("action")="" then

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

end if

A
abdemir author 8/1/2006

Alexey,
I changed my code with your code. its works
You are excellent and thank you
Bulent