Welcome Guest Search | Active Topics | Sign In | Register

Completely clearing out an Editor's Html property on load Options
Mark Rae
Posted: Saturday, February 26, 2011 6:54:29 PM
Rank: Advanced Member
Groups: Member

Joined: 11/13/2008
Posts: 43
Hi,

I'm using the eo:Editor control, and I'm trying to completely clear its Html when the page loads.

I've tried the following in the Page_Load event:
Code: C#
Editor1.Html = String.Empty;


but it still always contains <p>&nbsp;</p>

How can I remove this HTML?
eo_support
Posted: Saturday, February 26, 2011 8:15:54 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

This behavior is by design. Unlike a traditional text editor, the browser would not display the cursor if its content is really empty. So it is necessary to modify substitute empty string with "<p>&nbsp;</p>". As a result, you will need to manually check whether it is "<p>&nbsp;</p>" and then regard it as empty in your code if needed.

Thanks!
Mark Rae
Posted: Saturday, February 26, 2011 8:24:26 PM
Rank: Advanced Member
Groups: Member

Joined: 11/13/2008
Posts: 43
OK, I understand.

Is there a setting somewhere where I can turn of the final \n character? The default Html property is actually "<p>&nbsp;</p>\n"
eo_support
Posted: Saturday, February 26, 2011 8:33:07 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
No. You will need to handle that yourself.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.