Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have read the documentation where is explained how to replace line breaks with html tag.
Inside a jquery script I use this code:
@{ foreach(var itemfinale in CurrentPage.Children) { if(itemfinale.HasValue("descrizioneCompleta")) { <text> @{ var multiLine = @itemfinale.descrizioneCompleta; } $(".sfondo-nero-opaco").append("@Umbraco.ReplaceLineBreaksForHtml(multiLine)"); </text> } } }
But I received this error:
The best overloaded method match for 'Umbraco.Web.UmbracoHelper.ReplaceLineBreaksForHtml(string)' has some invalid arguments
On line:
@Umbraco.ReplaceLineBreaksForHtml(multiLine);
Where am I wrong ?
Hi,
Are you sure that @itemfinale.descrizioneCompleta returns a string?
You could try to print out a typeof or gettype at runtime on it..
If it is an object or something the error makes sense.
/Jesper
Hi Jesper :)
Yes, @itemfinale.descrizioneCompleta returns a string on two line. I saw it from the console...
Ok.
You could try to typecast to be sure:
multiLine.ToString()
or @Umbraco.ReplaceLineBreaksForHtml((string)multiLine)
Still it does not work
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Problem with replace line breaks
I have read the documentation where is explained how to replace line breaks with html tag.
Inside a jquery script I use this code:
But I received this error:
On line:
Where am I wrong ?
Hi,
Are you sure that @itemfinale.descrizioneCompleta returns a string?
You could try to print out a typeof or gettype at runtime on it..
If it is an object or something the error makes sense.
/Jesper
Hi Jesper :)
Yes, @itemfinale.descrizioneCompleta returns a string on two line. I saw it from the console...
Ok.
You could try to typecast to be sure:
multiLine.ToString()
or @Umbraco.ReplaceLineBreaksForHtml((string)multiLine)
/Jesper
Still it does not work
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.