BuildManager.CreateInstanceFromVirtualPath Method (String, Type)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Processes a file, given its virtual path, and creates an instance of the result.

Namespace:   System.Web.Compilation
Assembly:  System.Web (in System.Web.dll)

public static object CreateInstanceFromVirtualPath(
	string virtualPath,
	Type requiredBaseType


Type: System.String

The virtual path of the file to create an instance of.

Type: System.Type

The base type that defines the object to be created.

Return Value

Type: System.Object

The Object that represents the instance of the processed file.

The CreateInstanceFromVirtualPath method works for compiled and non-compile pages.

.NET Framework
Available since 2.0
Return to top