So I’m retrieving data from the Rally web service and the description field contains html tags.
My MVC page looks like this:
<table width="100%" id="stories">
<tr>
<td>ID</td>
<td>Name</td>
<td>Description</td>
<td>TaskEstimateTotal</td>
</tr>
@foreach (var story in Model.UserStories)
{
<tr>
<td>@story["FormattedID"]</td>
<td>@story["Name"]</td>
<td>@story["Description"]</td>
<td>@story["TaskEstimateTotal"]</td>
</tr>
}
</table>
The html tags appear as text
eg:
<DIV>As a Marketing Analytics And Data Manager</DIV>
I’ve tried encoding and decoding it but neither of those are producing the desired response. Encoding it will convert the < into < type text.
<td>@HttpUtility.HtmlEncode(story["Description"])</td>
Hopefully it’s just something simple I’ve missed!
Unless I should be stripping out the tags?
Have you tried:
MSDN: http://msdn.microsoft.com/en-us/library/gg480740(v=vs.98).aspx