Last post Nov 12, 2013 08:10 AM by Mordrey
Nov 06, 2013 11:20 AM|Mordrey|LINK
I have a custom control that dynamically creates an HTMLEditor. I want to set DocumentCssPath using an embedded resource file. The natural way would be
editor.DocumentCssPath = Page.ClientScript.GetWebResourceUrl(GetType(), "HTMLEditor.Document.css")
This doesn't work, because of how the editor is implemented. The editor checks checks whether the given path exists as a physical file, and otherwise uses its own stylesheet. The URL returned by
GetWebResourceUrl() is something like WebResource.axd?d=abc123, which is not a physical file, so the editor ignores my DocumentCssPath. Is there a way to work around this?
Nov 07, 2013 09:46 PM|Fuxiang Zhang - MSFT|LINK
HTMLEditor is an ASP.NET AJAX Control that allows you to easily create and edit HTML content. It has a default style which is embedded
as a WebResource and is a part of the Toolkit assembly that has styles set for all the sub-classes. You can see generated HTML markup and preview document.
From your description, I see that you want to use your own custom css style to the HTMLEditor. The solution you mentioned is
a practicable solution. You can change the look and feel of HTMLEditor using the HTMLEditor CssClass property.
Please check below link to get the css classes of HTMLEditor .
Hope this helps. Thanks.
Nov 07, 2013 10:57 PM|chetan.sarode|LINK
Please refer to:
Nov 12, 2013 08:10 AM|Mordrey|LINK
I want to set DocumentCssPath using an embedded resource file.
I decided to keep the .css file as a "physical" file instead of as an embedded resource. Getting it to work with embedded resources seems more complicated than what it's worth at the moment. Some of the suggested links mention setting the CssClass property,
but that only affects the chrome, and not the style inside the text editor.