NamespaceInfo Class
Contains a single configuration namespace reference, similar to the Import directive. This class cannot be inherited.
Assembly: System.Web (in System.Web.dll)
The NamespaceCollection contains NamespaceInfo objects, which correspond to the add elements within the namespaces section. Each NamespaceInfo object is the same as an Import (<%@ Import %>) directive that applies to all pages and controls in the scope of the configuration file. The Import directive allows you to import a namespace into your ASP.NET page, making all its classes available for use on your page.
This example demonstrates how to specify values declaratively for properties of the NamespaceCollection and NamespaceInfo classes.
The following configuration file example shows how to specify values declaratively for the namespaces section.
<system.web>
<pages>
<namespaces>
<add namespace="System" />
<add namespace="System.Collections" />
<add namespace="System.Collections.Specialized" />
<add namespace="System.ComponentModel" />
<add namespace="System.Configuration" />
<add namespace="System.Web" />
</namespaces>
</pages>
</system.web>
The following code example demonstrates how to use the NamespaceInfo class. This code example is part of a larger example provided for the PagesSection class.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.