Problem with setting up a default font for the editor text area

Last post 06-16-2008, 6:51 PM by ralc001. 2 replies.
Sort Posts: Previous Next
  •  06-15-2008, 7:29 PM 41424

    Problem with setting up a default font for the editor text area

    I have a problem setting up the default editor font for the text area.  After searching the forums, I found two properties mentioned that should help me do this.  EditorWysiwygModeCSS and EditorBodyStyle.
     
    First I tried setting the EditorWysiwygModeCSS to point to a stylesheet (Editor.css).  The editor.css file has the textarea style defined as follows:
     

    TEXTAREA

    {

    font-size: 10pt;

    color: black;

    font-family: Verdana, Tahoma, Arial;

    }

     
    When I go run the page, it shows verdana by default in the font dropdown.  However, as soon as I click on the text area, Times New Roman is selected.  Times New Roman is not specified anywhere in the stylesheet (nor in any stylesheet in the project).
     
    So then I tried to use the editorbodystyle property as below (put in the page.load event of the asp.net page)
    edtField10.EditorBodyStyle = "textarea { font:normal 12px arial; }"
     
    Same thing happens when I run the page.  Verdana is shown by default but when I click on the textarea, times new roman is selected.
     
    I then tried both solutions combined, still no luck.  Any help would be appreciated.  Thanks.
     
    PS Hopefully if you guys answer with a question and I reply to it you would answer back again.  My last few questions were answered with a question and when I replied back it was left unanswered after that (which defeats the purpose of asking the back up questions to begin with). 
     
     
     
     
  •  06-16-2008, 3:55 PM 41459 in reply to 41424

    Re: Problem with setting up a default font for the editor text area

    ralc001,
     
    This will not work:
     
    edtField10.EditorBodyStyle = "textarea { font:normal 12px arial; }"
     
    This is correct:
     
    <CE:Editor id="Editor1" runat="server" EditorWysiwygModeCSS="Editor.css"></CE:Editor>
     
     
    TEXTAREA
    {
    font-size: 10pt;
    color: black;
    font-family: Verdana, Tahoma, Arial;
    }
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  06-16-2008, 6:51 PM 41470 in reply to 41459

    Re: Problem with setting up a default font for the editor text area

    Thanks.  That did indeed seem to work.
     
    Which brings me to my next question:
     
    Is there a way to programatically set the default font?
     
    If a user prefers a default font (e.g. we have a dropdown with fonts on a "front page"), can I somehow pass on that font to the editor to use as a default?
     
    Will I have to somehow programatically change the textarea values in the stylesheet file?  Or will I have to have several stylesheets (with different fonts specified in each stylesheet for the textarea) and change the stylesheet that the EditorWysiwygModeCSS property points to?  Thanks again
View as RSS news feed in XML