Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8576467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:55:48+00:00 2026-06-11T19:55:48+00:00

When I save text/html from a text box using the HTML Editor Extender it

  • 0

When I save text/html from a text box using the HTML Editor Extender it keeps on stripping out new lines and divs.

I have found the why:

if a tag is not on a white list (in other words, not needed by an
HtmlEditorExtender button) then it gets stripped. We want to do
everything that we can to prevent Cross-Site Scripting attacks so we
need to limit the types of tags, attributes, and attribute values
which you are allowed to use. If you set the HtmlEditorExtender
property EnableSanitization=”false” then no stripping occurs — but
then you open yourself up to Cross-Site Scripting attacks.

http://stephenwalther.com/archive/2012/06/25/announcing-the-june-2012-release-of-the-ajax-control-toolkit.aspx#comment-4842

And I currently have the follow tools enabled on the toolbar:

<ajaxToolkit:HtmlEditorExtender ID="HtmlEditorExtender1" 
    TargetControlID="txtBody" DisplaySourceTab="false" 
    runat="server" Enabled="True">
    <Toolbar> 
        <ajaxToolkit:Bold />
        <ajaxToolkit:Italic />
        <ajaxToolkit:Underline />
        <ajaxToolkit:InsertOrderedList />
        <ajaxToolkit:InsertUnorderedList />
        <ajaxToolkit:CreateLink />
        <ajaxToolkit:UnLink />
        <ajaxToolkit:RemoveFormat />
    </Toolbar>
</ajaxToolkit:HtmlEditorExtender>

I added the button <ajaxToolkit:JustifyLeft /> and <div> tags are no longer being stripped, but ideally I don’t want to allow additional buttons.

Question:

Is there a way to white-list <br /> and <div> tags without adding additional buttons?

Any other options that you guys can think of?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T19:55:49+00:00Added an answer on June 11, 2026 at 7:55 pm

    Adding any justify button will make the htmleditor extender usable in internet explorer.

    <ajaxToolkit:Justifyleft /> 
    <ajaxToolkit:JustifyCenter /> 
    <ajaxToolkit:JustifyRight /> 
    <ajaxToolkit:JustifyFull /> 
    

    without these buttons, everything gets stripped and tags are not accepted. You mention that you have been able to get tags br accepted also, which button did you add to allow this to happen. This will make the htmleditorextender usable. Thanks.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using tinyxml to save input from a text ctrl. The user can
I have a simple html text-box hooked up to a .keypress(funcion(){...} which makes a
How is it possible to save text from a text field when the user
I have this program in Python which should save text files to a folder
I have a save button in a JFrame ;on clicking save the 'save' text
I have a small issue with a method that should save the text contained
I'm developing a web application using asp.net. There is a text box which contains
I was looking for HTML/Text content caching for small-mid size site using php. I'll
I have a text box and there is some text written on it. Now,
From the following HTML i need to extract email address only to save it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.