NamespaceCollection.AutoImportVBNamespace Property


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

Gets or sets a value that determines whether the Visual Basic namespace is imported without having to specify it.

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

[ConfigurationPropertyAttribute("autoImportVBNamespace", DefaultValue = true)]
public bool AutoImportVBNamespace { get; set; }

Property Value

Type: System.Boolean

true if the Visual Basic namespace is imported automatically; otherwise, false. The default is true.

For ASP.NET pages written using Visual Basic the Microsoft.VisualBasic namespace is automatically imported unless the AutoImportVBNamespace property is false.

The following code example shows how to use the AutoImportVBNamespace property. This code example is part of a larger example provided for the PagesSection class.

// Get the AutoImportVBNamespace property.
Console.WriteLine("AutoImportVBNamespace: '{0}'",

// Set the AutoImportVBNamespace property.
pagesSection.Namespaces.AutoImportVBNamespace = true;

.NET Framework
Available since 2.0
Return to top