rad editor problem

5 posts, 0 answers
  1. Umar
    Umar avatar
    5 posts
    Member since:
    Nov 2007

    Posted 17 Oct 2008 Link to this post

    hi

    i have a radeditor and have set its images path to "~/images" which works fine.

    but why wont this work "C:\images"  (not a valid virtual path error)

    is there any way around this.

    Thanks

  2. Rumen
    Admin
    Rumen avatar
    12848 posts

    Posted 20 Oct 2008 Link to this post

    Hello Umar,

    In particular cases, the nature of ASP.NET and IIS in particular does not permit you to use absolute paths which point outside your application. The ViewPaths and UploadPaths properties are one of these cases - you can use relative paths and/or virtual directories.

    The ViewPaths and UploadPaths properties should receive as an argument an array of string paths pointing to folders that should be:
    • a subdirectory of your web application
    • a directory placed in the root of IIS - you can set this folder by using the / forward slash symbol, e.g.
      RadEditor1.ImageManager.UploadPaths  = new String []{"/Images"};
    • a virtual directory of your web application that has a physical path pointing outside of your web application.
    • a shared drive that is a virtual folder of your web application. You can see the following KB article for more information: Uploading images and files to a Shared Drive.
    You can find more information here: Uploading images to the server (upload tab is disabled).

    Another approach is to implement your custom file system content provider that will be able to read the files for physical resources or virtual folders outside of the web application. You need to override the StoreFile function:

    protected void Page_Load(object sender, EventArgs e)
        {
            RadEditor1.ImageManager.ContentProviderTypeName = typeof(myprovider).AssemblyQualifiedName;
        }

        public class myprovider : Telerik.Web.UI.Widgets.FileSystemContentProvider
        {  
          
            public  myprovider(HttpContext context, string[] searchPatterns, string[] viewPaths, string[] uploadPaths, string[] deletePaths, string selectedUrl, string selectedItemTag)
            : base(context, searchPatterns, viewPaths, uploadPaths, deletePaths, selectedUrl, selectedItemTag)
            {
            }

            public override string StoreFile(UploadedFile file, string path, string name, params string[] arguments)
            {
                //code
                return base.StoreFile(file, path, name, arguments);
            }
        }


    Best regards,
    Rumen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Susan
    Susan avatar
    137 posts
    Member since:
    Jul 2007

    Posted 12 Apr 2009 Link to this post

    Is this solution posted anywhere in VB? I have looked but cannot seem to find it.

    Thanks,
    Susan
  5. Rumen
    Admin
    Rumen avatar
    12848 posts

    Posted 13 Apr 2009 Link to this post

    Hi Susan,

    You can use our online C# to VB.Net converter tool:
    http://converter.telerik.com/

    All the best,
    Rumen
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  6. Susan
    Susan avatar
    137 posts
    Member since:
    Jul 2007

    Posted 13 Apr 2009 Link to this post

    Thanks. Worked great.

    Susan
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017