Load snippets from external XML file

2 posts, 1 answers
  1. Dave Miller
    Dave Miller avatar
    64 posts
    Member since:
    Oct 2004

    Posted 03 Jan 2008 Link to this post

    I am using the default toolset and while I have added a few custom controls in the code behind (C#) I would like to be able to load the snippets from an external xml file. This way snippets could be added by someone as needed without C# experience or the need to rebuild the solution. Is this possible or would I need to use a complete Toolsfile.xml for this to work

  2. Answer
    Lini avatar
    2144 posts

    Posted 04 Jan 2008 Link to this post

    Hello Dave,

    You have two options. You can either use the existing tools file functionality in RadEditor, or use the ASP.NET theming mechanism .

    The RadEditor "Prometheus" control maintains backwards compatibility with the old RadEditor for ASP.NET so you can use virtually the same ToolsFile.xml in the new editor as well. The problem with this approach is that you must define all the editor tools in the tools file as well and also the people who change the snippets will also be able to change the editor tools. If you decide to use this approach, then in the code you simply need to set the ToolsFile editor property (a sample tools file is attached to this message):

    RadEditor1.ToolsFile = "~/Tools.xml";

    The second way to do this takes advantage of ASP.NET themes. Create a theme and add a skin file for the RadEditor control. In this skin file you can configure all RadEditor properties, including snippets. To enable these settings, simply set the page theme in your application. I have attached a sample RadEditor.skin file to this message. If you want to have different snippets for different pages, you can place multiple RadEditor definitions in the skin file and use different SkinID properties.

    Kind regards,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top