FreeTextBox复制粘贴的内容

时间:2012-09-20 12:02:49

标签: asp.net freetextbox

我正在使用FreeTextBox:

<FTB:FreeTextBox ID="txtFreeTextBox" RemoveServerNameFromUrls="false" ToolbarLayout="ParagraphMenu,FontFacesMenu,FontSizesMenu,FontForeColorsMenu|Bold,Italic,Underline,Strikethrough;Superscript,Subscript,RemoveFormat|JustifyLeft,JustifyRight,JustifyCenter,JustifyFull;BulletedList,NumberedList,Indent,Outdent;CreateLink,Unlink,InsertImageFromGallery,InsertRule,InsertTable|Cut,Copy,Paste;Undo,Redo,Print" runat="Server" Width="100%" BackColor="239,239,240"ImageGalleryUrl="../../ftb.imagegallery.aspx?rif=Public/RootImages/&cif=Public/RootImages/">
</FTB:FreeTextBox>

问题在于,当我粘贴到它中时,它会粘贴两次。有什么可以解决的吗?

1 个答案:

答案 0 :(得分:3)

使用IE9并将浏览器模式设置为Internet Explorer 9时,我遇到了这个问题(它在IE9 Comp View中正常工作)。我找到的修复是覆盖页面的html中的默认CancelEvent函数。我在正文标签上方添加了这个:

<script type="text/javascript">
    FTB_FreeTextBox.prototype.CancelEvent = function (ev) {
        try{
            ev.preventDefault();
            ev.stopPropagation();
        }
        catch (e) {
            if (FTB_Browser.isIE) {
                ev.cancelBubble = true;
                ev.returnValue = false;
            }
        }
    };
</script>

希望它也适合你!