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

I am taking a value from a string from a text column

String str = myListItem[field name].toString()

It many cases the field may contain html which i wish to remove but is somehow not visibly contained in str. When str is output to the webpart it still has the html tags. How can i return the field value with the html tags in the text?

share|improve this question
    
Sean, you mean the text contains HTML and you want to treat is as a string and show up on Label ? –  Arsalan Adam Khatri Nov 12 '12 at 7:46
add comment

1 Answer 1

use Server.HtmlDecode(string) Server.HtmlEncode(string) to endcode and decode HTML.

share|improve this answer
    
Welcome to SharePoint.SE! While this post may answer the question, we prefer more details such as "why". Please edit your post with additional details. See How to Answer for general guidelines. –  Kit Menke Nov 13 '12 at 19:47
add comment

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.