From: Paulo on 2 Sep 2009 11:40 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?
From: Bob Barrows on 2 Sep 2009 12:57 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
|
Pages: 1 Prev: Quick test for ActiveX? Next: IIS 7 and web.config for classic ASP |