I
InNeedOfAssistance
Hi,
Right now I have a repeater object that brings data back from a SQL Server
database based on search criteria from the user. The data is returned
correctly without problems but what I would like to do is highlight all of
the words the user has specified in his search criteria. For instance, if
the user searched for 'New Jersey' then each time these words show on the
webpage, I would like to have them highlighted.
Is this possible? I've tried several different ways to change the values
written out in the DataBinder.Eval statements but have been unsuccessful.
In the code sample below I would like to use the words in sDBSearchPhrase
and use them to highlight words in the dataItems "directions" and
"comments".
My code is something like this:
front end
======
<ItemTemplate>
<tr id="firstRow">
<td>
<%# DataBinder.Eval(Container.DataItem, "directions") %>
</td>
<td>
<%# DataBinder.Eval(Container.DataItem, "comments") %>
</td>
</tr>
</ItemTemplate>
code behind
========
oReader = clsSQL.get_SearchInfo(oConnection, sDBSearchPhrase)
MyRepeater.DataSource = oReader
MyRepeater.DataBind()
Thanks for taking the time to read this. Your suggestions would be greatly
appreciated.
Right now I have a repeater object that brings data back from a SQL Server
database based on search criteria from the user. The data is returned
correctly without problems but what I would like to do is highlight all of
the words the user has specified in his search criteria. For instance, if
the user searched for 'New Jersey' then each time these words show on the
webpage, I would like to have them highlighted.
Is this possible? I've tried several different ways to change the values
written out in the DataBinder.Eval statements but have been unsuccessful.
In the code sample below I would like to use the words in sDBSearchPhrase
and use them to highlight words in the dataItems "directions" and
"comments".
My code is something like this:
front end
======
<ItemTemplate>
<tr id="firstRow">
<td>
<%# DataBinder.Eval(Container.DataItem, "directions") %>
</td>
<td>
<%# DataBinder.Eval(Container.DataItem, "comments") %>
</td>
</tr>
</ItemTemplate>
code behind
========
oReader = clsSQL.get_SearchInfo(oConnection, sDBSearchPhrase)
MyRepeater.DataSource = oReader
MyRepeater.DataBind()
Thanks for taking the time to read this. Your suggestions would be greatly
appreciated.