BuildManager.CreateInstanceFromVirtualPath(String, Type) Method

Definition

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

public static object CreateInstanceFromVirtualPath (string virtualPath, Type requiredBaseType);

Parameters

virtualPath
String

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

requiredBaseType
Type

The base type that defines the object to be created.

Returns

The Object that represents the instance of the processed file.

Remarks

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

Applies to

Product Versies
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1