how to change the value of the data in a repeater

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

InNeedOfAssistance

I figured out how to do it. I'm putting the data values in a label and
manipulating the replacing the text in the label.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top