Objects and Namespaces in ASP.NET
The Object data type is a generic type that’s used for a variable if no other type is specified.
Namespaces is a “logical naming scheme for grouping related types“. What that means to us is that all objects used in ASP.NET are grouped by type, which makes them easy to find and use. Imagine the .NET namespaces as a file cabinet.
Namespaces represent exactly the same concept. Like objects are grouped together, an
HTMLInputTextBox object is grouped in the same namespace as the
HTMLAnchor object, because they both represent HTML-user interface controls displayed to the user.
Example: To use a namespace in an ASP.NET page, you must use the Import directive.
<%@ Import Namespace="System.Data" %>
The System namespace is the root namespace for the entire
. NET Framework thus, it contains all the basic and generic classes you’ll use in ASP.NET.These include the primitives (integers, strings, and so on), as well as all of the other namespaces in . NET. Since it is the root namespace.
Namespace Collection in ASP.NET:
CodeDom: It contains objects that represent the elements of a source code document.
Collections: It contains collection objects, such as lists, queues, and hash tables.
ComponentModel: It contains the classes that enable you to control the run and design-time behaviour of components and controls.
Configuration: It provides methods and objects that enable you to access .NET configuration settings.
Data: It contains classes that enable you to interact with data sources, constitutes ADO.NET.
Diagnostics: It contains classes that enable you to debug and follow the execution of your applications.
DirectoryServices: It provides access to Active Directory services.
Drawing: It contains classes that enable you to use basic, Graphical Display Interface (GDI) capabilities.
EnterpriseServices: It contains objects that enable you to control how components behave on a server.
Globalization: It contains classes that define culture-related information.
IO: It contains classes that enable you to read and write to data streams and files.
Management: It provides classes used to interface with WMI events and objects.
Messaging: It contains classes to interact with messages over a network. Net Provides classes to work with network protocols.
Reflection: It contains classes that enable you to view information about other types in the .NET Framework.
Resources: It contains classes that enable you to manage culture-specific resources.