The HTML text editor cannot be rendered if using the OBJECT tag within the HTML web resources text editor from the Microsoft Dynamics CRM 2011 SDK

This article helps you resolve the problem that occurs when you edit HTML Web Resources by using the text editor provided in the Microsoft Dynamics CRM application, and if an OBJECT tag is used in the source.

Applies to:   Microsoft Dynamics CRM 2011
Original KB number:   2712155

Symptoms

While editing HTML Web Resources using the text editor provided in the Microsoft Dynamics CRM application, if an OBJECT tag is used in the source, the text editor window will be Base64 encoded and therefore cannot be rendered.

Cause

The text editor provided in the Web Resource Form is intended for use with simple HTML editing. It is not suitable for more sophisticated HTML documents.

Resolution

For more sophisticated documents, you should edit the code in an external editor and use the Browse button to upload the contents of your file.

For example, a more complex HTML page that requires script to render the contents of the page will begin like the following sample:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
<title></title>
<script src="Script/Script.js" type="text/javascript"></script>
<link href="CSS/Styles.css" rel="stylesheet" type="text/css" />
</head>
<body onload="SDK.ImportWebResources.showData()">
<div id="results" />
</body>
</html>

After the document is opened in the text editor and saved, the HTML will be changed to this:

<HTML><HEAD><TITLE></TITLE>
<META charset=utf-8></HEAD>
<BODY contentEditable=true onload=SDK.ImportWebResources.showData()>
<SCRIPT type=text/javascript src="Script/Script.js"></SCRIPT>
<LINK rel=stylesheet type=text/css href="CSS/Styles.css">
<DIV id=results></DIV></BODY></HTML>

More information

Prevent Editing of Web Resources for Managed Solutions.

Because of the capability available for the HTML in web resources to be changed by using the text editor, it is recommended that managed properties are used to set complex HTML web resources as not customizable for managed solutions. When viewing web resources in the solutions window, use the Managed Properties button to open the Managed Properties dialog box to set the Customizable property to false.

For more information on Silverlight web resources, see Silverlight (XAP) web resources.