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

Relative path for external CSS file problem

1 Answer 260 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Paul Robertson
Top achievements
Rank 1
Paul Robertson asked on 19 Apr 2012, 11:22 AM

Hello

I have a radEditor for which I need to provide relative paths for its various CSS files.

For example:

<CssFiles>
  <trk:EditorCssFile Value="stylesheets/EditorContentArea.css" />
</CssFiles>

where the 'stylesheets' folder would be a subfolder in the same folder as the markup and code files.

But the relative path doesn't work, whereas using an absolute path is successful, e.g., this path does find the CSS file in question:

<CssFiles>
  <trk:EditorCssFile Value="~/[path_to_my_stylesheets]/EditorContentArea.css"

</CssFiles>

What could be occurring here? Is the a behaviour that can be configured and changed somehow to enable the use of a relative path. Possibly at the time of processing, the relative path is being determined from a different location to that of the markup file?

If anyone can point me in the right direction it would be very greatly appreciated!

Regards

 

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 21 Apr 2012, 12:44 PM
Hello,

The CssFiles property expects a virtual path which points to the root of the web application under which RadEditor resides. This means that the path should starts with ~/ .

What you can do is to put the CSS file(s) in some folder outside of the web application and make it using IIS a virtual folder pointing to the root of the web application.

All the best,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Editor
Asked by
Paul Robertson
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or