This project is read-only.

Change Color of TextEditor?

Topics: ASP.NET 2.0, Controls, Themes
Nov 21, 2011 at 3:14 AM

Hi Guys...

Quick question - how do I change the background color of the HTML editor in BE 2.5 please?

Here's the line of code I'm talking about...

<Blog:TextEditor runat="server" id="txtContent" TabIndex="4" />



Jan 12, 2012 at 7:55 PM


I wanted to know something similar: how to change the default height of the textbox. This is what I found:

The code you posted comes from Add_entry.aspx, which has this statement at the top:

<%@ Register Src="~/admin/htmlEditor.ascx" TagPrefix="Blog" TagName="TextEditor" %>

So wherever Blog:TextEditor is placed, the file htmlEditor.ascx is pulled. Of course, htmlEditor.ascx contains only three lines:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="htmlEditor.ascx.cs" Inherits="Admin.HtmlEditor" %>
<%@ Register Src="tinyMCE.ascx" TagName="tinyMCE" TagPrefix="uc1" %>
<uc1:tinyMCE ID="TinyMCE1" runat="server" />

So the only contents being pulled is the third line, which in turn pulls tinyMCE.ascx. That file contains lots of built in settings for the overall layout of editor and specific buttons and such. The textbox is formed at the bottom line: 

<asp:TextBox runat="Server" ID="txtContent" CssClass="post" Width="100%" Height="250px" TextMode="MultiLine" />

My problem is solved here, since I can just change the Height property to whatever I want. I tried adding the BackColor property (see here for a full of such properties), and for a split second the color was correct, then it changed back. The tinyMCE editor has it's own themes, and my guess is that the color is being overwritten by the theme. By default, the theme is set to "advanced", whose files are located in

<%=Utils.RelativeWebRoot %>editors/tiny_mce_3_4_3_1/themes/advanced
You might start there to see if anything else is specifying a value for BackColor of the textbox.

Hope that helps,