BuildManager.CreateInstanceFromVirtualPath Method (String, Type)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com 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
)

Parameters

virtualPath
Type: System.String

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

requiredBaseType
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
Show: