Reputation: 2133
I am inserting items into a Sharepoint list using C# and accessing the lists.asmx web service. One of the fields in the list is a multiple line text field (rich text), and I want to insert line breaks into the field. What characters do I put in the XML request to insert a line break? Thanks.
Upvotes: 2
Views: 23935
Reputation: 183
System.Environment.NewLine
I had the exact same problem, but neither <br />
nor <br/>
worked for me within <![CDATA[
In the end I removed CDATA and treated the text as a regular string, inserting the System.Environment.NewLine
property where ever a line break was needed.
Upvotes: 3
Reputation:
I have the same setup as you and I tired <br />
but it won't translate over if you are using an XML element to update the list.
When your generating your text, use <![CDATA[<br/>]]>
instead of <br />
.
This will translate over, tested and verified.
Upvotes: 4
Reputation: 10638
You can add <br />
tags to the text. the content of the field is stored in a CDATA element.
Upvotes: 2