Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

First off I want to be clear I am using the Silverlight Client Side Object Model in solution. So I cannot use objects/properties from the server object model.

What I am trying to do is get the plain text value of a field that is an enhanced rich text field. I know that I can use a RegEx to strip out the HTML, that is not what I am looking for as I would also have to deal with the character entities, etc. I am sure that I can find something pre-canned on the Internet but I would like to know if there is a native way of doing this in the CSOM.

I have tried some of the strategies in this thread (rich text to plain text), but have not managed to adapt them to the Silverlight CSOM.

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Apparently it was far easier than I expected...

item.FieldValuesAsText[FIELD_NAME]

instead of item[FIELD_NAME]

So...

string businessCase = item["Business_x0020_Case"] != null ? item.FieldValuesAsText["Business_x0020_Case"] : string.Empty;
share|improve this answer

I know the RegEx solution may not be your ideal solution, but it is indeed the least complicated. As for the character entities, etc., you can use HtmlDecode to decode any HTML character markups to plaintext.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.