Help removing ~ from an image URL

Michael Purgar asked on November 21, 2019 21:12

Hello everyone -

I have the following code in my transformation:

div class="CKcontentA" style="background-image: url('<%# Eval("ContentBG2") %>');background-repeat: no-repeat; background-size: 265px;"

It outputs the following HTML in the code:

div class="CKcontentA" style="background-image: url(' /getmedia/01126b60-b4de-478b-825c-14cca856be9d/REPLACETHIS.aspx?width=265&height=177&ext=.png');background-repeat: no-repeat; background-size: 265px;"

The ~ character is causing the image not to appear in the browser. When I've used almost identical code in other tags (such as an anchor tag) that character is not inserted and the image appears as a background to the DIV. Is there a way to phrase the initial call so as to exclude the ~ character?

EDIT: the forum seems to be stripping the tilde ~ out of the code example before the ~/getmedia

Correct Answer

Michael Purgar answered on November 21, 2019 21:39

Actually I figured it out, just had to hit my head against the keyboard harder... heh.

1 votesVote for this answer Unmark Correct answer

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