Jared
Jared

Reputation: 2133

How to insert a new line into a Sharepoint multiple line field?

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

Answers (3)

Neville
Neville

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

Gav.S
Gav.S

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

Colin
Colin

Reputation: 10638

You can add <br /> tags to the text. the content of the field is stored in a CDATA element.

Upvotes: 2

Related Questions