Nate Pet
Nate Pet

Reputation: 46322

asp.net c# show the html rendering

I am trying to retreive pull up the following:

<table border="0" cellpadding="2" cellspacing="7" style="vertical-align:top;">
    <tr>
    <td width="80" align="center" valign="top"><font style="font-size:85%;font-family:arial,sans-serif"></font></td>
    <td valign="top" class="j">
        <font style="font-size:85%;font-family:arial,sans-serif"><br />
        <div style="padding-top:0.8em;">
            <img alt="" height="1" width="1" />
        </div>
        <div class="lh">
            <a href="http://news.google.com/news/url?sa=t&amp;fd=R&amp;usg=AFQjCNEjddVUpIXf528-P5S0D0z5A0_QjQ&amp;url=http://www.daytondailynews.com/news/news/local/letter-points-to-plumbing-in-2011-legionnaires-out/nSmCp/">
        <b>Letter points to plumbing in 2011 <b>Legionnaires</b>&#39; outbreak at hospital</b></a><br /><font size="-1">
        <b><font color="#6f6f6f">Dayton Daily News</font></b></font><br />
        <font size="-1">A letter entered into court records identifies for the first time several factors that may have caused an outbreak of <b>Legionnaire&#39;s disease</b> in Miami Valley Hospital&#39;s new 12-story patient tower shortly after it opened in late 2010. The outbreak, at the <b>...</b></font><br /><font size="-1" class="p"></font><br />
        <font class="p" size="-1"><a class="p" href="http://news.google.com/news/more?ncl=dRROval94f0jKyM&amp;ned=us"><nobr><b></b></nobr></a></font></div></font>
    </td>
    </tr>
</table>

Which is formatted in html on my .aspx page.

I am doing the following:

<%#  XPath("description").ToString()%>  

but it is not showing me the html rendering of it. What I like to show it to me converted into HTML. as description is already in HTML, why is it not showing it to me?

Upvotes: 0

Views: 151

Answers (1)

estebane97
estebane97

Reputation: 1138

Use Literal Control

<asp:Literal id="Literal1" runat="server" text='<%# XPath("description").ToString() %>' />

Upvotes: 1

Related Questions