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

HTMLEditorExtender display problem

$
0
0

Hi there!

I have an ASP.NET page that has a textbox on it with an HTMLEditorExtender control and an ADD/UPDATE button that allows my users to enter, read, update and delete HTML formatted text to and from a text field in a SQL Server database table.  I'm using the HTTPUtility.HTMLDecode to control the display of the formatted text within the textbox. 

The data in the text field in the database table is stored with all the appropriate HTML tags intact, as I expect, and when the data is retrieved from the database and loaded into the textbox, the HTTPUtility.HTMLDecode function correctly processes the embedded HTML tags and displays the formatted text correctly.

Well, almost!  I am having a bizarre problem with some text becoming invisible on postback.  What happens is if I enter several lines of text and each of these lines is shorter than the width of the textbox (i.e. none of the lines wraps around), then once I click the ADD/UPDATE button only the first line remains visible.  The other lines are still there on the page (but invisible!) and I can move my cursor over them.  If I position the cursor somewhere on one of these invisible lines and press the backspace key, the lines magically become visible again (minus the character I just erased with the backspace key).  If I click the ADD/UPDATE button again, the lines become invisible again.  Checking the database shows that everything is added and updated correctly (i.e. text for all the lines, visible or not, is in the text field in the database).

This odd behaviour only happens when all the lines of text are shorter than the width of the textbox and there is no wrap around anywhere.  If at least one line of text exceeds the width of the textbox and wraps around, then this problem doesn't occur and everything is fine.

Has anyone else experienced this?  Any ideas as to what might be causing it?  I've spent the last two days scouring the web searching for answers and I'm still scratching my head.

Any help at all would be greatly appreciated!

Note:  I did try removing the HTMLEditorExtender control and just use a plain textbox and the problem does not occur, so I believe the culprit is the HTMLEditorExtender control.

Cheers!  Smile

 

Chris.


Viewing all articles
Browse latest Browse all 5678

Trending Articles



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