I’ve latly been working on a MCMS 2002 project where one of the primary gools have
been to make the public part of the site accessable following WAI
recomendations. So in order to do that I went for Xhtml
1.0 Transitional. The ActiveX content editor shipping with MCMS 2002 is not compliant
with xhtml standard (I secretly wonder if it’s compliant with any html standard).
It does stuff like not ending <li>-tags.
So I found Telerik
r.a.d editor Lite Edition. It has has a license model where licensed MCMS 2002
customers are allowed to use it whitout any extra cost. The Telerik editor seemd to
work as a charm, with one ”small” issue. It put’s <span>-tags around it’s output.
According to XHTML it’s not allowed place block-level elements (such as <p>
or <table>) inside an inline element (such as <a>, <span> or
<font>). And there is your problem right there.
Inpired of Paul Haack’s exellent post ”Using
a Decorator to Hook Into A WebControl’s Rendering for Better XHTML Compliance”
I set of doing the following.
First off I have created my own HtmlTextWriter class in for the purpose you can read
about in Pual’s post.
writer) : base(writer)
publicoverridevoid AddAttribute(string name, string value)
privatebool IsLanguageAttribute(string name)
return String.Compare(name, ”language”, true,
CultureInfo.InvariantCulture) == 0;
Since I could see no conflict with what I’m about to do I reused it. Second step is
to inherit from the Telerik editor Placehoder RadEditorPlaceHolderControl and decorate
it a little.
As you can see I don’t mess with much. The magic of course happens in the overridden
I had to override the Render method to and put in my own HtmlTextWriter to work. I
don’t really understand why but if I didn’t I got really weird output. But there you
have it; hopefully this is helpful to someone.
In the name of usability I realized I shoud supply some example code for the aspx-pages
to. So in the Foo.aspx fiile you need to change the reference from:
Register TagPrefix=”Teleric” Namespace=”Telerik.WebControls” Assembly=”RadEditorPlaceHolder” %>
to something like:
Register TagPrefix=”XhtmlCompliance” Namespace=”MyProject.XhtmlCompliance” Assembly=”MyProject” %>
And when using the editor in the html page change:
id=”Radeditorplaceholdercontrol1” runat=”server” PlaceholderToBind=”FooPH”></Teleric:RadEditorPlaceHolderControl>
use the ”new” editor:
id=”Radeditorplaceholdercontrol1” runat=”server” PlaceholderToBind=”FooPH”></XhtmlCompliance:CompliantRadEditor>