Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > NewLine in transformation View modes: 
User avatar
Member
Member
wensveen-evident - 8/25/2011 4:31:22 PM
   
NewLine in transformation
Hi,

I have a situation where I specifically need CR+LF newlines (0x0D 0x0A) to be output by a transformation. In the transformation itself, I used newline (enter / return), since this should be sent to the server as CRLF (per some spec). I assumed that after the transformation is applied, the CRLF would remain. Unfortunately, only a 0x0A character is output.

Is there some way to work around this? Or should I put everything on one line and output the CRLF with a databinding expression, like <%# "\r\n" %> or something?

Thanks in advance,
Matthijs Wensveen

User avatar
Kentico Support
Kentico Support
janh-kentico - 8/26/2011 8:07:45 AM
   
RE:NewLine in transformation
Hi Matthijs,

could you please insert following two HTML entities into your transformation:

&#13;&#10;


Please let me know if it works.

User avatar
Member
Member
wensveen-evident - 8/26/2011 9:40:07 AM
   
RE:NewLine in transformation
Hi Janh,

That would probably work, but I'd still have to put everything on one line with these entities in between.

Also, before the first character of the transformation, there is a newline in the output, and I need that to be a CRLF as well, or nothing at all, so I can put it in the code before the CMSRepeater.

I've worked around it now, by inheriting the CMSRepeater control and overriding the Render method where I replace the generated "\n" characters with "\r\n". This could have been done in the code-behind of the page template (ASPX) as well. A control Adapter would have worked too. Anyway, the problem is solved :)

Cheers,
Matthijs