How to insert a new line in a Sharepoint multi-line box?
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 text box with multiple lines (rich text) and I want to insert line breaks in the field. What characters am I putting in the XML query to insert a line break? Thank.
I have the same setup as you and I are tired of <br />
, but it won't translate if you use an XML element to update the list.
When you create your text, use instead . <![CDATA[<br/>]]>
<br />
This will be translated, tested and verified.
You can add tags <br />
to text. the contents of the field are stored in a CDATA element.
System.Environment.NewLine
I had the same problem but neither <br />
nor <br/>
worked for me in <![CDATA[
. In the end, I removed the CDATA and treated the text like a normal string, inserting a property System.Environment.NewLine
where a line break was ever needed.