Solved

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

Posted on 2013-01-11
10
2,640 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

738 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