String Replace in RSS Repeater Transformation

Aldrin Christopher Mirasol asked on November 11, 2015 06:53

How can I replace a string in an ASCX transformation inside RSS webpart repeater?

Correct Answer

Jan Hermann answered on November 11, 2015 08:21


It depends what string you are talking about. I suppose the string is in some field you want to retrieve in your transformation using the Eval method. In this case, you can simply convert it to string and use the Replace method like this:

<%# Eval("yourField").ToString().Replace("str1", "str2") %>

Best regards,
Jan Hermann

1 votesVote for this answer Unmark Correct answer

Recent Answers

Brenden Kehren answered on November 11, 2015 14:39

You can also use <%# Eval<string>("YourField").Replace("str1", "str2") %>

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.