how to stop < and > from being rendered into &lt and &gt in a listitem (bulletedlist)


T

Tony

I want to display the text of items in a bulletedlist on multiple lines, but
I can't get it working. Here is a sample version of my code below:

protected void blStaff_DataBound(object sender, EventArgs e)
{
foreach (ListItem lstItem in ((BulletedList)sender).Items)
{
lstItem.Text = "A" + "<br>" + "B";
}
}

Instead of placing "<br"> between "A" and "B", when the page renders, the
<br> becomes &ltbr&gt. I tried Environment.Newline(), '\n', the character
60 (<), nothing worked Help is greatly appreciated, thanks.
 
Ad

Advertisements


Top