This is a migrated thread and some comments may be shown as answers.

Add editor css files from code not working

4 Answers 60 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Ziga HABJAN
Top achievements
Rank 1
Ziga HABJAN asked on 01 Oct 2008, 11:47 AM
Hi,

i'm having some trouble setting the styles to content iframe of radeditor. If i set it up like this:

<telerik:RadEditor ID="RadEditor1" runat="server" ToolbarMode="Default" Width="600px" Height="600px" EditModes="Design">
    <CssFiles>
        <telerik:EditorCssFile Value="~/Css/EditPageContentMiska.css" />
    </CssFiles>
    <Content>
    </Content>
</telerik:RadEditor>

everything works just fine (the defaults styles are imported from css file), while as to if i do it behind the code like:

RadEditor1.CssFiles.Add("~/Css/EditorPageContentMiska.css");

then the styles dont apply to my content area. I'm setting editor's css file on Page_Load event. Am i doing something wrong? (need this coz the style defaults will be changed based on login)

thanks in advance,
Žiga


*** edit

The behind code works just fine - i had some trouble with cached css i guess. But the problem is still described in my 2nd post (only css defaults for body element are applyed)

4 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 01 Oct 2008, 12:33 PM
Hi Žiga,

You have correctly set the CssFiles collection property in the codebehind and you should not experience this problem. For your convenience I have attached a video and a sample project demonstrating how this functionality works on my side.

If you still experience any problems, open a support ticket and send a sample working project that demonstrates them. I will examine it and provide a solution after that.

Best regards,
Rumen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Ziga HABJAN
Top achievements
Rank 1
answered on 01 Oct 2008, 12:46 PM
Thanks for quick reply. Stlyes from body tag are infact copyed to content of radeditor.

But now i added a definition for h1 to EditorPageContentMiska.css in project you submited:

h1

{
color: Blue;
}

When i type text in heading1 style, the style is not applyed.

re,
Žiga

0
Rumen
Telerik team
answered on 01 Oct 2008, 01:01 PM
Hi Ziga,

I added the

h1
{
    color: Blue;
}

global class to the EditorPageContentMiska.css file, saved the file and cleared my browser cache. After that I restarted the browser and I was able to see the new heading 1 style applied to the content area. See the attached video.

The content area of RadEditor is editable IFRAME and the browser caches its css styles. That is why you need to make sure that the browser cache is deleted.

Best regards,
Rumen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Ziga HABJAN
Top achievements
Rank 1
answered on 01 Oct 2008, 01:19 PM
So after clearing browser cache + rebooting my workstation my original code works just fine <_<

Thanks for support, you guys are the best!

re,
Žiga
Tags
Editor
Asked by
Ziga HABJAN
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Ziga HABJAN
Top achievements
Rank 1
Share this question
or