System.Web.Hosting.VirtualPathProvider.DirectoryExists Method

Gets a value that indicates whether a directory exists in the virtual file system.

Syntax

public virtual bool DirectoryExists (string virtualDir)

Parameters

virtualDir
The path to the virtual directory.

Returns

true if the directory exists in the virtual file system; otherwise, false.

Remarks

Override the VirtualPathProvider.DirectoryExists(string) method to indicate to the compilation system that the resource represented by virtualDir exists in the virtual file system provided by this System.Web.Hosting.VirtualPathProvider instance.

If your custom System.Web.Hosting.VirtualPathProvider class does not support directories, the VirtualPathProvider.DirectoryExists(string) method should return false.

Note:

If your virtual file system will contain themes for the Web site (by creating a virtual App_Themes directory), your custom System.Web.Hosting.VirtualPathProvider class must support directories.

Requirements

Namespace: System.Web.Hosting
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0