When past some thing from the Ms word, the content of ajaxToolkit:HtmlEditorExtender is changed why? RRS feed

  • Question

  • User1735516446 posted

    I'm using the  ajaxToolkit:HtmlEditorExtender  control.  when I past some content from MS-word to the control ,it's looking fine first, but after I submmit,   the content is changeed   it's the view the html source code .why?

    How can I over it?  I'm using the

    Saturday, December 7, 2013 2:17 AM


  • User-417640953 posted

    Hi Baileyjl,

    Thank you post the issue to asp.net forum.

    As we all know the HtmlEditorExtender depend on its handler assembly "sanitizer" encode the text of textbox.

    If you want the content copied from word showing as its style please try use the "Server.HtmlDecode" method like below.

            <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager>
            <asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine" Rows="20" Width="467px"></asp:TextBox>
            <asp:HtmlEditorExtender ID="HtmlEditorExtender1" runat="server" TargetControlID="TextBox1" DisplaySourceTab="true" ></asp:HtmlEditorExtender>
            <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />

    Code Behind:

      protected void Button1_Click(object sender, EventArgs e)
                TextBox1.Text = Server.HtmlDecode(TextBox1.Text);

    And this is a know issue, you can check it from below link. Thanks.


    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, December 10, 2013 8:58 PM

All replies