asp.net.ph

Skip Navigation Links

@ Import

ASP.NET Syntax   ASP.NET Page Syntax   Page Directives


Explicitly imports a namespace into a page, making all classes and interfaces of the imported namespace available to the page. The imported namespace can be part of the .NET Framework class library or a user-defined namespace.

<%@ Import namespace = "value" %>

Attributes


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

Remarks

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

The following namespaces are automatically imported into all pages:


Syntax Example

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

<%@ Import Namespace = "System.Net" %>
<%@ Import Namespace = "Grocery" %>
See Also

Page Directives



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note