How can I stop ASP.Net from encoding anchor tags in List Items when the page renders?
I have a collection of objects. Each object has a link property. I did a foreach and tried to output the links in a BulletedList, but ASP encoded all the links.
Any idea? Thanks!
Here's the offending snippet of code. When the user picks a specialty, I use the SelectedIndexChange event to clear and add links to the BulletedList:
if (SpecialtyList.SelectedIndex > 0)
{
PhysicianLinks.Items.Clear();
foreach (Physician doc in docs)
{
if (doc.Specialties.Contains(SpecialtyList.SelectedValue))
{
PhysicianLinks.Items.Add(new ListItem("<a href=\"" + doc.Link + "\">" + doc.FullName + "</a>"));
}
}
}