Solved

How do I prevent the Ajax Control Toolkit HtmlEditorExtender from removing BR Tags?

Posted on 2013-01-11
10
2,561 Views
Last Modified: 2013-01-25
Hi Experts! I just updated my website with the latest version of the Ajax Control Toolkit for .Net, and I'm having trouble with the HtmlEditorExtender removing <BR> line break tags.

I followed the guidance found at http://stephenwalther.com/archive/2012/06/25/announcing-the-june-2012-release-of-the-ajax-control-toolkit.aspx, but it doesn't solve the problem.

Without setting EnableSanitization to false, is there a way to have it not remove these tags?
0
Comment
Question by:Drevo
  • 4
  • 3
  • 3
10 Comments
 
LVL 19

Expert Comment

by:Manoj Patil
ID: 38769846
0
 
LVL 23

Assisted Solution

by:Roopesh Reddy
Roopesh Reddy earned 350 total points
ID: 38771372
Hi,

Seems like some limitations with that! Why don't you try CKEditor, which is a great option, moreover it's an alternative and very powerful!

http://ckeditor.com/blog/CKEditor-for-ASP.NET-3.6.2-Released

Again, it's a suggestion!!!

Hope it helps u...
0
 

Author Comment

by:Drevo
ID: 38774883
Thanks for your comments! I'm still looking to find a way to make the Ajax Control Toolkit HtmlEditorExtender work though... Anyone know how?

techChallenger: The link you posted just ends with suggesting posting a bug report, and the other link is the one I included in my question.

roopeshreddy: I'll give CKEditor a look.

Thanks!
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 23

Expert Comment

by:Roopesh Reddy
ID: 38774938
Hi,

I still feel that the HtmlEditorExtender has a defect! So, i suggest you, have a look at CKeditor!

It might help u!
0
 
LVL 19

Assisted Solution

by:Manoj Patil
Manoj Patil earned 150 total points
ID: 38776152
While using ckeditor, remember one thing.
You need to nullify the default css style for HTML tags like <b> , <p>
If not, then it fails to show you the designed layout.
Means if you are doing a font bold or any font-family from editor and the place where you are using this, which have the parent div with an css then it may happen that the it doesn't show you the actual layout for font.
0
 

Accepted Solution

by:
Drevo earned 0 total points
ID: 38785063
I'm considering CKEditor (as well as TinyMCE),

However, to answer my own question, I've found that I can replace the "<br>" (encoded as "&lt;br&gt;") in the text of the target for the HtmlEditorExtender at the Page_Load event with a placeholder, and then later in the page life cycle replace the placeholder with the original "<br>" text. Them seems like a ridiculous solution though, so I'll leave this question open a little longer in case someone has a better way to handle this.
0
 
LVL 19

Expert Comment

by:Manoj Patil
ID: 38785144
While placing text to Editor,
Have you tried, In Page_Load()
String OutputText = Server.HtmlDecode(InputText);
0
 
LVL 23

Expert Comment

by:Roopesh Reddy
ID: 38796336
Hi,


I observed, When you press Enter key in the HtmlEditor, it is inserting a <DIV> instead of <br /> tag!

Did you checked that?
0
 

Author Comment

by:Drevo
ID: 38799406
Thanks for your comments!

techChallanger1: That method doesn't fix the issue.

roopeshreddy: It actually inserts a "<br>" tag within the <div> tags.

If someone else in the future see's this question, see my Page_Load placeholder workaround. It seems the HtmlEditorExtender validation just doesn't work well without modification or a less than elegant fix.
0
 

Author Closing Comment

by:Drevo
ID: 38818022
I'm awarding points based on the alternate suggestions provided. However, no one provided a working answer to my question. My answer, the one I marked as the best solution, is the only one that answered the question I posted.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question