0

We have a list with Title and Data (multi line field)as columns.

The data field has got html text with all html tags.

When we retrieve and display this text on an page then the html tags can be seen.

We use code like:

divValue.innerHTML=listItems[0]["Data"].ToString();

Any idea?

2

Try this code :

var field = listItem.Fields.GetFieldByInternalName("Data");     
var htmlValue = field.GetValueAsHtml(listItem[field.Id]);
divValue.innerHTML = htmlValue;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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