Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
Previous Versions
.NET Framework 2.0
General Reference
ASP.NET Reference
Global.asax Syntax
 @ Import

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
.NET Framework General Reference
@ Import

Explicitly imports a namespace into an ASP.NET application file (such as a Web page, a user control, a master page, or a Global.asax file), making all classes and interfaces of the imported namespace available to the file. The imported namespace can be part of the .NET Framework class library or a user-defined namespace.

<%@ Import namespace="value" %>
namespace

The fully qualified name of the namespace to import. This can include any of the namespaces included in the .NET Framework or a custom namespace.

The @ Import directive cannot have more than one namespace attribute. To import multiple namespaces, use multiple @ Import directives.

A set of namespaces can be automatically imported into .aspx pages. The imported namespaces are defined in the machine-level Web.config file, within the <namespaces> section of the <pages> element. The following namespaces are automatically imported into all pages:

The following code example imports the .NET Framework base-class namespace System.Net and the user-defined namespace Grocery.

<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="Grocery" %>
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker