
Michael Cranford
Top achievements
Rank 1
Michael Cranford
asked on 16 Mar 2009, 02:37 AM
I'm painfully converting my solutions from Q2 2007 to Q1 2009 AJAX. One thing I'm having a problem with is the ToolsFile for RadEditor. In the past, I used an ASPX page to provide dynamic content to the control (especially the links). When I try to do this now, it doesn't work, I get an error. It appears as if the control is not executing the page, but is rather reading it as if it were a text file, which means the dynamic content will not be included, and an error will occur (as the page tag is incorrectly processed). Am I right about this? Is there any workaround?
Michael
Michael
7 Answers, 1 is accepted
0
Hello Michael,
I tried to reproduce the reported problem with RadEditor for ASP.NET AJAX in both IIS and Cassini VS web server, but unfortunately to no avail. For your convenience I have attached a video demonstrating my test and my aspx test files.
Kind regards,
Rumen
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
I tried to reproduce the reported problem with RadEditor for ASP.NET AJAX in both IIS and Cassini VS web server, but unfortunately to no avail. For your convenience I have attached a video demonstrating my test and my aspx test files.
Kind regards,
Rumen
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0

Michael Cranford
Top achievements
Rank 1
answered on 21 Mar 2009, 07:14 PM
The interesting difference about your sample and what I'm trying to do is that you include a full URL path to the toolsfile.aspx page. Try putting toolsfile.aspx into this field (assuming the relative path) and the error occurs. So there is a difference in how RadEditor digests the tools file, apparently, when there is a full URL path as opposed to a simple page name. It didn't used to work this way. The problem, I think, is that I would not want to edit every instance of the control in my CMS to reflect the absolute URL of each client's web site. I'd rather use a relative path (i.e., toolsfile.aspx all by itself) so that I can deploy this for any particular URL. If you have a workaround, let me know.
0
Hi Michael,
The observed behavior in the new editor is by design - if the path begins with HTTP:// then the editor downloads the file via the web server. If the path starts with ~/ then the editor opens the file directly from the file system. That is why it is not possible to load the tools set from an aspx file if its path starts with "~/".
Best regards,
Rumen
the Telerik team
Check out Telerik Trainer , the state of the art learning tool for Telerik products.
The observed behavior in the new editor is by design - if the path begins with HTTP:// then the editor downloads the file via the web server. If the path starts with ~/ then the editor opens the file directly from the file system. That is why it is not possible to load the tools set from an aspx file if its path starts with "~/".
Best regards,
Rumen
the Telerik team
Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0

Michael Cranford
Top achievements
Rank 1
answered on 24 Mar 2009, 03:51 PM
It seems to me that this is a mistake, because an ASPX page is always inherently going to be an executed page. Your older version of the RadEditor handled this correctly, this one doesn't. An ASPX page should be treated as a local http path when http is excluded; I can't think of an instance where I would ever want this to work differently. I am lodging an official complaint and request for you to change this back to the way it used to be. :)
0
Hi Michael,
Thank you for your feature request for the new editor. I logged it in our ToDo list but I cannot an estimate when it will be implemented because its priority is not high.
Kind regards,
Rumen
the Telerik team
Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Thank you for your feature request for the new editor. I logged it in our ToDo list but I cannot an estimate when it will be implemented because its priority is not high.
Kind regards,
Rumen
the Telerik team
Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0

woaksie
Top achievements
Rank 2
answered on 22 Sep 2009, 05:43 PM
I totally agree with Michael on this issue. I have the same problem. I am adding my vote to get this bumped up to a higher priority.
P.S. If you use the object browser and look at the documentation on the ToolsFile property it tells you it should work with a relative URL.
P.S. If you use the object browser and look at the documentation on the ToolsFile property it tells you it should work with a relative URL.
public
string ToolsFile { set; get; }
Member of
Telerik.Web.UI.RadEditor
Summary:
Gets or sets a string containing the path to the XML toolbar configuration file.
Remarks:
This property is provided for backwards compatibility. Please, use either inline toolbar declaration or code-behind to configure the toolbars. To configure multiple RadEditor controls with the same settings you could use either Theme, UserControl with inline declaration, or CustomControl.
Use "~" (tilde) as a substitution of the web-application's root directory.
You can also provide this property with an URL which returns a valid XML toolbar configuration file, e.g. /MyApplication/Tools/MyToolsFile.aspx
0
Hello,
Unfortunately, in this case the documentation is wrong. We will update it so clearly shows you need an absolute URL for an ASPX tools file. The XML file from the ToolsFile property is loaded into an XmlDocument and then processed by the editor control. The MSDN docs say that the path can be either a local file or a HTTP URL (http://msdn.microsoft.com/en-us/library/875kz807.aspx). This means that if you specify a relative path for the ToolsFile (starting with "/" or "~/") then it will be loaded as a local file on the server by the XmlDocument.Load() method. If you specify a path that starts with "http://" or "https://" then it will be requested using a web request.
In order to use a ASPX file for a tools file, you need ASP.NET to process the file and output valid XML. Therefore you have to use a http or https request, otherwise the file will not be handled by ASP.NET and the XmlDocument will open it directly.
If you want to open an ASPX file from the current site as a tools file for the editor and you do not wish to hardcode the server URL, you can use the following code:
All the best,
Lini
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Unfortunately, in this case the documentation is wrong. We will update it so clearly shows you need an absolute URL for an ASPX tools file. The XML file from the ToolsFile property is loaded into an XmlDocument and then processed by the editor control. The MSDN docs say that the path can be either a local file or a HTTP URL (http://msdn.microsoft.com/en-us/library/875kz807.aspx). This means that if you specify a relative path for the ToolsFile (starting with "/" or "~/") then it will be loaded as a local file on the server by the XmlDocument.Load() method. If you specify a path that starts with "http://" or "https://" then it will be requested using a web request.
In order to use a ASPX file for a tools file, you need ASP.NET to process the file and output valid XML. Therefore you have to use a http or https request, otherwise the file will not be handled by ASP.NET and the XmlDocument will open it directly.
If you want to open an ASPX file from the current site as a tools file for the editor and you do not wish to hardcode the server URL, you can use the following code:
string absoluteToolsUrl = Request.Url.Scheme + "://" + Request.Url.Authority + Page.ResolveUrl("~/Path/to/ToolsFile.aspx"); |
RadEditor1.ToolsFile = absoluteToolsUrl; |
All the best,
Lini
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.