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. Advertisements

  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. Advertisements

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. Jimmy Tran

    Using ASP.NET to work with MS Words

    Jimmy Tran, May 6, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    454
  2. Peter Strøiman
    Replies:
    1
    Views:
    2,375
    Peter Strøiman
    Aug 23, 2005
  3. Richard Heathfield
    Replies:
    7
    Views:
    627
    Barry Schwarz
    Oct 5, 2003
  4. utab

    Words Words

    utab, Feb 16, 2006, in forum: C++
    Replies:
    6
    Views:
    681
    Daniel T.
    Feb 16, 2006
  5. BerlinBrown
    Replies:
    6
    Views:
    7,046
  6. Lasse Edsvik

    replace words with bold words

    Lasse Edsvik, Oct 5, 2003, in forum: ASP General
    Replies:
    9
    Views:
    485
  7. Jack
    Replies:
    8
    Views:
    326
  8. pantagruel
    Replies:
    8
    Views:
    772
    Dr John Stockton
    Jul 22, 2006
Loading...