Highlithing words + asp

Discussion in 'ASP General' started by Paulo, Sep 2, 2009.

  1. Paulo

    Paulo Guest

    On the classic asp how can I return the words highlited on a search field
    with the tag below:
    <span style="background-color:#FFFF00">KeyWord returned</span>

    So if I search a bookStore with the keyword, example: asp
    "Select Title from books where title like '%asp%' "

    if returns me:

    "Learn asp in 10 days", will just highlited on screen: "Learn <asp> in 10
    days"
    "Creating components in asp", will just highlited on screen: "Creating
    components in <asp>"

    How to do it in classic asp?
     
    Paulo, Sep 2, 2009
    #1
    1. Advertising

  2. Paulo

    Bob Barrows Guest

    Paulo wrote:
    > On the classic asp how can I return the words highlited on a search
    > field with the tag below:
    > <span style="background-color:#FFFF00">KeyWord returned</span>
    >
    > So if I search a bookStore with the keyword, example: asp
    > "Select Title from books where title like '%asp%' "
    >
    > if returns me:
    >
    > "Learn asp in 10 days", will just highlited on screen: "Learn <asp>
    > in 10 days"
    > "Creating components in asp", will just highlited on screen: "Creating
    > components in <asp>"
    >
    > How to do it in classic asp?


    Use the Replace function:
    hiliteprefix="<span style=""background-color:#FFFF00"">"
    hitlitesuffix="</span>"
    srchword="asp"
    srchResult=<one of the results of the search>
    srchResult=Replace(srchResult,srchword, _
    hiliteprefix & srchword & hitlitesuffix)

    Response.Write srchResult
    --
    HTH,
    Bob Barrows
     
    Bob Barrows, Sep 2, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Strøiman
    Replies:
    1
    Views:
    2,110
    Peter Strøiman
    Aug 23, 2005
  2. Richard Heathfield
    Replies:
    7
    Views:
    380
    Barry Schwarz
    Oct 5, 2003
  3. utab

    Words Words

    utab, Feb 16, 2006, in forum: C++
    Replies:
    6
    Views:
    436
    Daniel T.
    Feb 16, 2006
  4. BerlinBrown
    Replies:
    6
    Views:
    4,646
  5. Lasse Edsvik

    replace words with bold words

    Lasse Edsvik, Oct 5, 2003, in forum: ASP General
    Replies:
    9
    Views:
    245
Loading...

Share This Page