Solved

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

Posted on 2013-01-11
10
2,519 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
 
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now