asp检索怎样用颜色标注查询结果?

来源:百度知道 编辑:UC知道 时间:2024/09/22 13:32:21
例如查询“文章”,数据库中content表单中内容为“一系列精品文章”
我想在返回结果上的“一系列精品文章”中的文章用红色显示,怎样实现?

例如查询的关键字是 文章 如下所写
<%=replace(rs("一系列精品文章"),文章,"<font color=red>"文章"</font>")%>

keywords 是要搜索的内容 content 为文章全部内容
<%=replace(rs("content"),keywords,"<font color=red>"&keywords&"</font>")%>

<font color="#FF0000">一系列精品文章</font>