[RESOLVED] Problem displaying comments in inner HTML
I have to display some HTML from our system and do by using
DivOutline.InnerHtml = outlinetext;
where outlinetext is a string of HTML
However the string contains code as below
"<!--[if !supportLists]-->"
which for some reason also gets displayed.
I think it could be because the actual string is
("<!--[
but even when I try
outlinetext.Replace("<", "<");
the text does not seem to get replaced
Can anyone tell my either how to make the comments not display or why the string.replace function cannot pict out "<" when I can see it is definately in the string?
Re: Problem displaying comments in inner HTML
Resolved
Code:
outlinetext = outlinetext.Replace("<!--", "<!-- ");
outlinetext = outlinetext.Replace("<", "<");
// outlinetext.Replace("<!--[if !supportLists]-->", "");
outlinetext = outlinetext.Replace(">", ">");
outlinetext = outlinetext.Replace("-->", " -->");
// outlinetext.Replace("<!--[endif]-->", "");
Re: [RESOLVED] Problem displaying comments in inner HTML
Hello,
Out of interest, what type of control is DivOutline?
I have found that writing HTML into a Literal control provides better success than most of the others.
Gary