This topic is locked

Highlight Search Results

4/23/2013 10:50:33 AM
ASPRunnerPro General questions
acaruson author

I'm new to ASPRunner, however, not completely new to ASP. Looking for some advice or a sample.
I'm using ASPRunner Professional 7.2 (Build 15275).
I'd like to highlight the results of an advanced search. Something like this in the "Before Show" event:
[indent]Dim txt

txt=Request.QueryString("[color="#FF0000"]SEARCHVARIABLE")
tbl_table.
[b][b]Anyone have any ideas? Done this before? Have a sample? (Thank you in advance!)
[/b]

Sergey Kornilov admin 4/23/2013

Here is how you can get access to search variables (besides parsing the URL):

http://xlinesoft.com/asprunnerpro/docs/print_search_parameters_on_list_page.htm
To highlight search results you can either use 'View as' type 'Custom' or events like List page: Before record processed:

http://xlinesoft.com/asprunnerpro/docs/before_record_processed.htm
The latter is more convenient if you want to highlight the content of several fields.

data("FieldName")=Replace(data("FieldName"),txt,"<font color=RED><i><b>" & txt & "</i></b></font>", 1, -1, vbTextCompare)
acaruson author 5/7/2013



Here is how you can get access to search variables (besides parsing the URL):

http://xlinesoft.com/asprunnerpro/docs/print_search_parameters_on_list_page.htm
To highlight search results you can either use 'View as' type 'Custom' or events like List page: Before record processed:

http://xlinesoft.com/asprunnerpro/docs/before_record_processed.htm
The latter is more convenient if you want to highlight the content of several fields.

data("FieldName")=Replace(data("FieldName"),txt,"<font color=RED><i><b>" & txt & "</i></b></font>", 1, -1, vbTextCompare)



Sorry, but I'm still stumped on what is probably the simplest thing.
On a basic list page, what is the value of the string entered into the search field? I want to create an if/then statement with it, however, nothing I try seems to work.

Sergey Kornilov admin 5/8/2013

Here is what you looking for:

if not IsEmpty(Session(CSmartStr(strTableName) & "_advsearch")) then

doAssignmentByRef searchClauseObj,unserialize(Session(CSmartStr(strTableName) & "_advsearch"))

end if
Response.write searchClauseObj.var_where(searchClauseObj.sessionPrefix & "_simpleSrch")
acaruson author 5/8/2013



Here is what you looking for:

Response.write searchClauseObj.var_where(searchClauseObj.sessionPrefix & "_simpleSrch")



Isn't there still pieces missing? I feel like it.
If the name of my table is "tbl_links_master", what would a simple message look like in the "List page: After record processed" section? Wouldn't I need to declare "searchClauseObj"? Where does the code you provided learn what the table name is?
DIM "something"

something = "figure out what value was entered in the search field"

response.write "something"

Sergey Kornilov admin 5/8/2013

I have updated my code sample to provide the complete example.

acaruson author 5/8/2013



I have updated my code sample to provide the complete example.


First, I very much appreciate the help.
When I implement the code, nothing happens. Nothing is written to the screen, regardless of whether I run a search (and have data in the search field) or not.
I also don't understand why the first two lines reference "_advsearch" and the response.write line calls on "_simpleSrch". Why is this?
Some variable must be sending what I put in the search field to the "where" clause of the SQL. That's what I'm desperately trying to capture.
Thanks again.

Sergey Kornilov admin 5/9/2013

I have tested this code with ASPRunnerPro 7.2 before posting a reply here. It worked. Probably you putting this code to wrong event or your version of ASPRunnerPro is different.
If something doesn't work for you post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.