KB Article KA20012
Visible to All Users

ASPxHtmlEditor HTML correction

Description:
Why is the inserted HTML markup modified even if the ASPxHtmlEditor HTML markup validation is disabled?

Answer:
Our ASPxHtmlEditor provides built-in HTML markup validation. Nevertheless, this is not the only validation.

A browser automatically validates any HTML markup that is assigned to the innerHTML property. User HTML markup is inserted in a page hierarchy when the ASPxHtmlEditor initiates a callback to the server (i.e., when a user switches the View). The browser modifies invalid user HTML markup. However, even valid HTML markup can be modified by the browser. This occurs on the client side before a callback is sent and the result depends on a particular browser. Every browser has its internal rules on how to correct inserted markup.

On the server side, the ASPxHtmlEditor corrects user HTML markup according to XHTML Transitional standard (starting from v12.2 HTML5 standard is also supported). This correction may be canceled in the ASPxHtmlEditor.HtmlCorrecting event handler if e.Handled is set to true. However, in this case, custom logic should be implemented to correct the modified HTML according to the XHTML Transitional or HTML5 standard. Otherwise, a markup modified by a browser will be used in an ASPxHtmlEditor.

We have created the How a browser modifies custom HTML markup entered by a user example that allows you to test how a browser modifies custom HTML markup online.

Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.