1

在使用ajax HtmlEditorExtender时我遇到了一个奇怪的问题。即width属性消失,图像缩小。
最初我textbox与之相关的HtmlEditorExtender有这个文本

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在此页面上使用任何内容。

4

1 回答 1

0

根据设计,AjaxControlToolkit 删除了添加到 HtmlEditorExtender 内容中的 html 元素的宽度、类和 id 属性。您可以下载工具包的源代码并进行一些小的修改以防止这种情况发生。

看看Yuriy RozhovetskiyHTMLEditorExtender 的回答删除了“class”、“id”属性

于 2013-05-20T18:02:07.143 回答