Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AjaxControlToolKit HTMLEditorExtender adding anchor tag as a normal text when a link is added

I am unable to write a nice title to this topic because my problem is a little weird. I am using AjaxControlToolkit HTMLEditorExtender in my website to send HTML formatted emails. Every other feature like bold, italic, underline etc. are working fine but when I add a link it shows the HTML code of it as follows:

enter image description here

As you can see BOLD is working but the anchor tag is appearing in HTML code format.

Code for extender and the textbox:

<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 any one please tell me why this is happening? Is this some bug with the extender?

like image 413
Shiva Pareek Avatar asked Mar 16 '13 15:03

Shiva Pareek


2 Answers

Considering I do not have enough reputation for commenting on the post, I will ask a followup question here. Is there any way we could see the text you are getting on your C# backend? This is a possible source for the issue if the string has some weird formatting.

Plus email clients are not meant to be browsers and there is a possibility that the email client will not render the html correctly.

like image 172
lbdm44 Avatar answered Oct 12 '22 11:10

lbdm44


Is that image a screen shot of the editor itself? I created my own test project using your same code.

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

The only difference is that I didn't bother implementing a sanitizer, which it appears you did. I would try disabling the sanitizer (just for testing purposes) and see if that's where your problem lies.

like image 27
Smeegs Avatar answered Oct 12 '22 12:10

Smeegs