Solved

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

Posted on 2013-01-11
10
2,621 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…

713 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