
332
|
Chapter 12: The Language Reference
This is the Title of the Book, eMatter Edition
Copyright © 2006 O’Reilly & Associates, Inc. All rights reserved.
• You do not have to use the
Imports statement to import namespaces into an ASP.
NET application. Instead, you can import a namespace into an ASP.NET applica-
tion in a number of ways:
• By creating an “
<add namespace>” directive in a web.config configuration file.
For example:
<compilation>
<namespaces>
<add namespace="System.IO" />
...
</namespaces>
imports the System.IO namespace within the scope defined in the web.config
file.
• By adding an “
@ Import” directive to global.asax. For example:
<%@ Import namespace="System.IO" %>
imports the System.IO namespace for the ASP.NET application.
• By adding an “@ Import” page directive. This has the same form as the global.
asax directive and must appear at the beginning of the page.
Example
Imports MVB = Microsoft.VisualBasic
See Also
Namespace Statement
Inherits Statement
Syntax
Inherits className
className (required)
The name of the inherited (base) class
Description
The Inherits statement specifies the name of the class from which a new class is being
derived; it specifies the base class of the current class. The statement appears immedi-
ately after the
Class statement or the Interface statement.
Usage at a Glance
• The Inherits statement must be the first line of code in the class or interface. It
can be preceded ...