Getting editor to apply styles to highlighted text based on selected CssClass DropDown item

Last post 01-28-2010, 3:18 PM by Adam. 3 replies.
Sort Posts: Previous Next
  •  01-26-2010, 12:35 PM 58369

    Getting editor to apply styles to highlighted text based on selected CssClass DropDown item

    I have spent a couple hours trying to figure this out, searched your documentation, looked through forums but for for the life of me, can't get it to work.
     --------------
    I am able to dynamically populate my CssClass drop down list just fine. The problem is, when I highlight some text in the Editor Window then select a CssClass to apply to it, I can't get the editor window to recognize the styles that are associated with the class and apply them in the editor window.
     
    When I apply a class, it correctly sets the HTML to:  <span class="bigred">please work</span>
     
    But, in the Normal and Preview mode, it is displayed simply as "please work" instead of what it should be: "please work"
     
    If you tell me to set  the "EditorWysiwygModeCss", I might shoot myself in the face because I have tried that 100 times in 100 different ways and nothing even comes close to working. Half of the time when I set EditorWysiwygModeCss, nothing even shows up in the drop down list (I have AutoParseClasses = false). 
     
    I have tried to make this as simple as possible. I created a .css file in the application root with a single class
    .bigred { font-size:18px; font-weight:bold; color:Red; }
    and have tried setting the  EditorWysiwygModeCss to point to this file.
     
     WHAT AM I MISSING??? There must be some trick or maybe it's not possible but on your main default demo you have a highlighted CssClass and it applies a highlight to the selected text so it must be possible. Thanks! -Phil
    Filed under:
  •  01-26-2010, 12:41 PM 58371 in reply to 58369

    Re: Getting editor to apply styles to highlighted text based on selected CssClass DropDown item

    How did you set EditorWysiwygModeCss property?

    Have you set Editor.AutoParseClasses Property to true?
     
    In the following example (http://cutesoft.net/example/general.aspx ) the css dropdown is auto populated from css http://cutesoft.net/example/example.css.
     
    Here is the Editor code:
     
    <CE:Editor id="Editor1" EditorWysiwygModeCss="example.css" runat="server" ></CE:Editor>
     
    Hope it helps.
     
    Keep me posted

    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

  •  01-26-2010, 2:17 PM 58376 in reply to 58369

    Re: Getting editor to apply styles to highlighted text based on selected CssClass DropDown item

    Thanks for the response...
     
    I was finally able to figure out that setting the BaseHref to another domain was causing it to break. The problem is, I need the BaseHref set to another domain in order for all of the images to be displayed properly.

    I can think of 2 possible solutions (maybe you have ideas?)
     
    1. Is there a Property that I can set where I pass in a list (or String) of Styles to be used by the editor instead of a filename that will be read in? That way, I don't have to deal with paths at all.
     
    2. Is there way to for the editor not to use the BaseHref when resolving the  EditorWysiwygModeCss Property?

    Thanks again for your help. I purchased Cute Editor and Ajax Uploader and very happy with both.  
  •  01-28-2010, 3:18 PM 58427 in reply to 58376

    Re: Getting editor to apply styles to highlighted text based on selected CssClass DropDown item

    sincell,
     
    You can use EditorBodyStyle to apply your style to the editor body.
     
    You can also set Editor.AutoParseClasses Property to false so that Cute Editor will not parse the CSS classes from EditorWysiwygModeCss and populate all items into CssClass dropdown.

    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

View as RSS news feed in XML