Rename and delete file with CustomFileSystemProvider

2 posts, 0 answers
  1. Denis
    Denis avatar
    5 posts
    Member since:
    Sep 2010

    Posted 12 Jan 2011 Link to this post

    Hello, with this ( custom provider I can't delete and rename files. I fixed it:

    public override string GetPath(string path)
        // First add the '~/' signs in order to use the VirtualPathUtility.GetDirectory() method ;
        /*string PathWithTilde = "~/" + path;
        string virtualPath = VirtualPathUtility.GetDirectory(PathWithTilde);
        virtualPath = virtualPath.Remove(0, 2);// remove the '~' signs
        return virtualPath;*/
        string virtualPath = "";
        if (Path.GetFileName(path).Length > 0)
            virtualPath = path.Replace(Path.GetFileName(path), "");
        return virtualPath;

    It's correct?
  2. Rumen
    Rumen avatar
    14471 posts

    Posted 17 Jan 2011 Link to this post

    Hi Denis,

    Yes, your code looks correct and if it works as expected you can use it.

    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top