AjaxControlToolKit HTMLEditorExtender adds an anchor tag as plain text when adding a link

I can’t write a good headline for this topic because my problem is a bit strange. I am using AjaxControlToolkit HTMLEditorExtender on my website to send HTML emails. Every other function, such as bold, italics, underlining, etc., works fine, but when I add a link, it displays the HTML code as follows:

enter image description here

As you can see, BOLD works, but the anchor tag is displayed in HTML code format.

Code for the expander and text field:

<asp:TextBox ID="TextBox2" runat="server" Height="376px" TextMode="MultiLine" Width="795px"></asp:TextBox> <asp2:HtmlEditorExtender ID="TextBox2_HtmlEditorExtender" runat="server" Enabled="True" TargetControlID="TextBox2"> </asp2:HtmlEditorExtender> 

Can someone tell me why this is happening? Is this a mistake with the expander?

+7
source share
3 answers

Given that I do not have enough reputation to comment on this post, I will ask the following question here. Is there any way to see the text you get in your C # backend? This is a possible source of the problem if the string has some weird formatting.

Plus, email clients are not designed for browsers, and there is a chance that the email client will not display html correctly.

+1
source

Is this image a screenshot of the editor itself? I created my own test project using the same code.

Also, how did you create the link? I typed in text, highlighted the text and clicked on the “create link” icon, and from there I typed in the URL. He created the link as expected.

The only difference is that I did not bother to introduce the disinfectant that you think you made. I would try disabling the sanitizer (for testing purposes only) and see if your problem is where it is.

+1
source

Try this, it should solve your problem -

 txtEmialMsg.Text=Server.HtmlDecode(ActualStringFromExtender.ToString()); 

Or, if you get text (A href), then you need to use the following command when sending emails

 Server.UrlDecode(link) 
0
source

All Articles