BaseTemplateParser.GetUserControlType Method

This method supports the .NET Framework infrastructure and is not intended to be used directly from your code.
Compiles and returns the type of the UserControl object that is specified by the virtual path.

Namespace: System.Web.UI
Assembly: System.Web (in system.web.dll)

protected internal Type GetUserControlType (
	string virtualPath
protected Type GetUserControlType (
	String virtualPath
protected internal function GetUserControlType (
	virtualPath : String
) : Type
Not applicable.



The virtual path of the UserControl.

Return Value

The type of the user control.

Exception typeCondition


The UserControl specified by virtualPath is marked as no compile.

- or -

The parser does not permit a virtual reference to the UserControl.

If a PageParserFilter object is defined and its AllowVirtualReference property is false, the GetUserControlType method raises an HttpException exception.

Additionally, if the UserControl object that is referenced by the virtual path is marked as a no-compile control, an HttpException exception will be thrown. To force a UserControl to be compiled, set the compilation mode attribute in its @ Control directive to the Always field. To set the compilation mode for pages and controls across an application, set the compilationMode attribute of the pages Element (ASP.NET Settings Schema) in the Web.config file.

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions