Looking for a method to replace a string with a hyperlink

Posted by Richard West on Stack Overflow See other posts from Stack Overflow or by Richard West
Published on 2010-04-07T21:18:21Z Indexed on 2010/04/07 21:23 UTC
Read the original article Hit count: 303

Filed under:
|
|

I have a usercontrol in an asp web forms application that I am working on in C#.

I am binding to a repeater and outputting a field of information, named "Text", using the following syntax:

<%# DataBinder.Eval(Container.DataItem, "Text") %>

I am looking for a method that will allow my to search for a keyword within the string that is returned from above, and replace that string with a hyperlink such as

<a href="www.anysite.com/keyword">keyword</a>.

I'm not very familer with user controls and getting data back in this manner so I am looking for advice on how this might be best handled.

Thanks!

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET