how to remove tags in text while displaying on a web page

909 views Asked by At

I am using TFS API and I try am trying to access a property "Description" of an object "WorkItem" I want to display this property on a web page.

When I display this on the web page , this is what I see :

<p>This task is created for our SSRS team&#160;Sesame project.</p> 

Firstly , I wanted to know if this is a html tag or does it mean something else in TFS . And secondly , is there a way I can display this in plain text ?

 This task is created for our SSRS team Sesame project.

Please let me know.

2

There are 2 answers

0
Marcin Zablocki On

If you just want to remove tags, see this simple solution (it uses Regular Expressions): Remove HTML tags in String

It could be even better if you create it as a extension method.

2
MrHinsh - Martin Hinshelwood On

This is HTML as the System.Description field is an HTML one.

If you just write the field out to a tag it should render as text without the tags. The browser hosting the webpage will render them like any other HTML tags.