Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

HtmlEditorExtender change HTML code of a loaded page

$
0
0

Hi,

I try to use the HtmlEditorExtender to give users the possibilty to change part of their own webpages. The content of these pages is saved in a MSSQL Database.

By starting the page the content from the database is loaded to the textbox linked to the HtmlEditorExtender. So this is what the HTML Code looks like:

<div class="art-post"> <div class="art-post-tl"></div> <div class="art-post-tr"></div> <div class="art-post-bl"></div> <div class="art-post-br"></div> <div class="art-post-tc"></div> <div class="art-post-bc"></div> <div class="art-post-cl"></div> <div class="art-post-cr"></div> <div class="art-post-cc"></div> <div class="art-post-body">  <div class="art-post-inner">   <h2 class="art-postheader">This is a Headline</h2>    <div class="art-postcontent">  <div class="box_content_left">  <p>Write your text here</p></div>    </div></div></div></div>    

When I now switch from Design-view to Code-view the code has been changed like this:

<div class="art-post"><div class="art-post-tl"></div><div class="art-post-tr"></div><div class="art-post-bl"></div><div class="art-post-br"></div><div class="art-post-tc"></div><div class="art-post-bc"></div><div class="art-post-cl"></div><div class="art-post-cr"></div><div class="art-post-cc"></div><div class="art-post-body"><div class="art-post-inner"><h2 class="art-postheader">This is a Headline</h2><div class="art-postcontent"><div class="box_content_left"><p>Write your text here</p></div></div></div></div></div>

So all returns have been deleted and the code is now difficult to read.

When I now change back to Design-view and only change the color of the <h2>This is a Headline</h2> to red - the code has been changed again:

<div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div><div><h2><font color="#ff0000">This is a Headline</font></h2><div><div><p>Write your text here</p></div></div></div></div></div

All Div class names have been removed  Yell Yell Yell

This page will not work anymore ... why does this happen?

How do I prevent the code from being changed like this?

Joachim


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>