I need to display a string which contains HTML as an html page.
I'm using this xaml:
<telerik:RadRichTextBox
x:Name="radRichTextBox"
IsSpellCheckingEnabled="False" />
and this code:
this.radRichTextBox.Document = LoadHtmlFile(sContent);
public static RadDocument LoadHtmlFile(string content)
{
HtmlFormatProvider provider = new HtmlFormatProvider();
return provider.Import(content);
}
the content string contains the following:
"<HTML>\r\n<HEAD>\r\n<STYLE TYPE=\"text/css\"> \r\n<!-- \r\n.RedText \r\n{ \r\ntext-decoration:underline; \r\ncolor:#0000FF; \r\n} \r\n.BlueText \r\n{ \r\ntext-decoration:line-through; \r\ncolor:#FF0000; \r\n} \r\n--> \r\n</STYLE> \r\n\r\n<TITLE>\r\nTextCompare:: c:\\testdata\\20newstxt\\Atheism\\alt.atheism\\51123.TXT VS c:\\testdata\\20newstxt\\Atheism\\alt.atheism\\51127.TXT\r\n</TITLE>\r\n<script type=\"text/javascript\">\r\n<!--\r\nfunction Loading() { \r\n\tfor (x = 0; x < document.images.length; x++) {\r\n\t\tdocument.images[x].style.display =\"none\"; \r\n\t}\r\n}\r\nfunction CountImg() { \r\n\treturn document.images.length;\r\n}\r\nfunction Next(Sshow,Shide) {\r\n\tvar xx = parseInt(Sshow)-1;\r\n\tvar yy = parseInt(Shide)-1;\r\n\tif ( xx >= 0)\r\n\t\tdocument.images[xx].style.display =\"\";\r\n\tif ( yy >= 0 && !(xx == yy))\r\n\t\tdocument.images[yy].style.display =\"none\"; \r\n}\r\n-->\r\n</script>\r\n\r\n</HEAD>\r\n<BODY onLoad='Loading()'>\r\n\r\n<TABLE>\r\n<TR><TD>Base </TD><TD><A HREF=\"c:\\testdata\\20newstxt\\Atheism\\alt.atheism\\51123.TXT\">c:\\testdata\\20newstxt\\Atheism\\alt.atheism\\51123.TXT</A></TD></TR>\r\n<TR><TD>Modified</TD><TD><A HREF=\"c:\\testdata\\20newstxt\\Atheism\\alt.atheism\\51127.TXT\">c:\\testdata\\20newstxt\\Atheism\\alt.atheism\\51127.TXT</A></TD></TR>\r\n</TABLE>\r\n\r\n<HR>\r\n\r\n<P>\r\nFrom: keith@cco.caltech.edu (Keith Allan Schneider) \r\n<BR/>\r\nSubject: Re: <IMG src=\"flag1.jpg\" name=\"C211\" alt=\"Flag\"/>\r\n<SPAN CLASS=\"BlueText\">Political Atheists? </SPAN><SPAN CLASS=\"RedText\">>>>>>>Pompous ass </SPAN>\r\n<BR/>\r\nOrganization: California Institute of Technology, Pasadena \r\n<BR/>\r\nLines: <IMG src=\"flag1.jpg\" name=\"C212\" alt=\"Flag\"/>\r\n<SPAN CLASS=\"BlueText\">11 </SPAN><SPAN CLASS=\"RedText\">14 </SPAN>\r\n<BR/>\r\nNNTP-Posting-Host: punisher.caltech.edu <IMG src=\"flag1.jpg\" name=\"C213\" alt=\"Flag\"/>\r\n<SPAN CLASS=\"BlueText\">\r\n<P/>\r\narromdee@jyusenkyou.cs.jhu.edu (Ken Arromdee) </SPAN><SPAN CLASS=\"RedText\">\r\n<P/>\r\nlivesey@solntze.wpd.sgi.com (Jon Livesey) </SPAN>writes: <IMG src=\"flag1.jpg\" name=\"C214\" alt=\"Flag\"/>\r\n<SPAN CLASS=\"BlueText\">\r\n<P/>\r\n>>The motto originated in </SPAN><SPAN CLASS=\"RedText\">\r\n<P/>\r\n>>>How long does it [the motto] have to stay around before it becomes </SPAN>the <IMG src=\"flag1.jpg\" name=\"C215\" alt=\"Flag\"/>\r\n<SPAN CLASS=\"BlueText\">Star-Spangled Banner. Tell me </SPAN><SPAN CLASS=\"RedText\">\r\n<P/>\r\n>>>default? ... Where's the cutoff point? \r\n<P/>\r\n>>I don't know where the exact cutoff is, but it is at least after a few \r\n<P/>\r\n>>years, and surely after 40 years. \r\n<P/>\r\n>Why does the notion of default not take into account changes \r\n<P/>\r\n>in population makeup? \r\n<P/>\r\nSpecifically, which changes are you talking about? Are you arguing </SPAN>that <IMG src=\"flag1.jpg\" name=\"C216\" alt=\"Flag\"/>\r\n<SPAN CLASS=\"BlueText\">this has \r\n<P/>\r\n>>something to do with atheists. \r\n<P/>\r\n>The </SPAN><SPAN CLASS=\"RedText\">the </SPAN>motto <IMG src=\"flag1.jpg\" name=\"C217\" alt=\"Flag\"/>\r\n<SPAN CLASS=\"BlueText\">_on_coins_ originated </SPAN><SPAN CLASS=\"RedText\">is interpreted </SPAN>as <IMG src=\"flag1.jpg\" name=\"C218\" alt=\"Flag\"/>\r\n<SPAN CLASS=\"RedText\">offensive by </SPAN>a <IMG src=\"flag1.jpg\" name=\"C219\" alt=\"Flag\"/>\r\n<SPAN CLASS=\"BlueText\">McCarthyite smear which equated atheism \r\n<P/>\r\n>with Communism and called both unamerican. \r\n<P/>\r\nNo it didn't. The motto has been on various coins since </SPAN><SPAN CLASS=\"RedText\">larger portion of </SPAN>the <IMG src=\"flag1.jpg\" name=\"C220\" alt=\"Flag\"/>\r\n<SPAN CLASS=\"BlueText\">Civil War. \r\n<P/>\r\nIt was just required to be on *all* currency in the 50's. </SPAN><SPAN CLASS=\"RedText\">\r\n<P/>\r\npopulation now than 40 years ago? </SPAN>\r\n<BR/>\r\nkeith \r\n\r\n</P>\r\n\r\n<HR>\r\n\r\n<P>\r\nDocument comparison created by Equivio>Compare, a product of <a href=\"http://www.equivio.com\">Equivio</a>\r\n\r\n</P>\r\n</BODY>\r\n</HTML>"
The displayed result is a blank page.
What am I doing wrong here?