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

Remote CSS file issue

1 Answer 64 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Paul Wood
Top achievements
Rank 1
Paul Wood asked on 16 Jul 2008, 05:04 AM
When attaching a remote CSS file to RadEditor (so it populates the Apply Styles dropdown and styles the content window) an error appears in Firefox.

The content window gets styled fine, but the dropdown list doesn't get populated and raises the following error when you click to open it:

Error: [Exception... "Security error"  code: "1000" nsresult: "0x805303e8 (NS_ERROR_DOM_SECURITY_ERR)"  location: "......./ScriptResource.axd?d=istbqLAKAKLE7MGyk4QnBSrjUlOysgIJA5wDbtqJvcTScOvohrIs9h6a2TybRNxJf7Nn8kodjh9xLdIIRBFrEg2&t=633493986000000000 Line: ....."]

This is probably due to some client-side security restriction of Firefox that is not present in Internet Explorer.

Is there a workaround or is this in line to be patched?

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 16 Jul 2008, 08:08 AM
Hi Paul,

Unfortunately there is no way to accomplish this on the client side - client browser security prevents code originating from one domain to access resources from another domain.

Some of the editor tools and dialogs need to process the css files specified to the editor in order to provide their respective functionality (e.g. the ability for the user to pick up a css class).

Our suggestion in this case is to come up with some server scheme that requests the files from the remote server, and then serves them to the browser - so that everything on the editor's page originates from the same server.


You can
place your external css files in a virtual directory that points to the root of your web application with RadEditor. Thus the browser will be able to access and read these files, after that the editor will parse the classes and it will populate the "Apply CSS Dropdown":

RadEditor1.CssFiles = new string[2] {"~/css/class2.css", "~/css/custom.css"};



Best regards,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Editor
Asked by
Paul Wood
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or