在使用ajax HtmlEditorExtender时,我遇到了一个奇怪的问题。即width属性消失,图像缩小。
最初,与HtmlEditorExtender关联的我的textbox具有以下文本
txtMessage.Text = "<span style=\" padding:10px 0px 10px 0px; width:100%; \"><img src=\"../images/img4layout2.png\" width=\"675px\" height=\"300px\" ></span><span style=\"font-weight: normal;\">Some text here.</span>";图像是这样的。

当我单击页面上的任何dropdown或任何其他控件时,HtmlEditorExtender的源代码神秘地变成这样(现在没有width属性)
<span style=" padding:10px 0px 10px 0px; width:100%; "><img src="../images/img4layout2.png" height="300px"></span><span style="font-weight: normal;">Some text here.</span>最后,图像看起来像这样。

我没有在这个页面上使用任何javascript。
发布于 2013-05-21 02:02:07
通过设计,AjaxControlToolkit删除了添加到HtmlEditorExtender内容的html元素的宽度、类和id属性。您可以下载该工具包的源代码,并进行一些小的修改以防止这种情况发生。
看看Yuriy Rozhovetskiy对HTMLEditorExtender removes “class”, “id” attributes的回应。
https://stackoverflow.com/questions/15050560
复制相似问题