Solved

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

Posted on 2013-01-11
10
2,543 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
DevOps Toolchain Recommendations

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

 

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

DevOps Toolchain Recommendations

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

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
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.…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

863 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

21 Experts available now in Live!

Get 1:1 Help Now