This topic is locked

To Display no Record if Search word is left Empty

11/16/2008 6:19:56 AM
ASPRunnerPro General questions
P
paulyap2k author

Hi There,
Wondering if anyone of you have done this and able to share on how to achieve this in both search on list page, andadvance search page
I wanted to display no records instead of all records when users did not enter any search words and hit enteror when search button is click.
Any help is greatly appreciated.
Thanks,

Paul

J
Jane 11/17/2008

Hi,
use List page: Before SQL query event on the Events tab for this purpose.

Here is a sample for simple search:

if request.querystring("a")="search" and request.querystring("SearchFor")="" then

strWhereClause = whereAdd(strWhereClause,"1=0")

end if

P
paulyap2k author 11/18/2008

Hi Jane,
It works well, thanks