11 namespaces to remember in Aspnet Web Applications
In this article we will discuss the some importance of namespaces in Aspnet applications.The following are the...
1)The System.Web.Services.Configuration Namespace :
The System.Web.Services.Configuration namespace contains three .NET attributes that are useful if you want to add custom format extensions to your web services (in other words, if you want to insert additional XML
elements to your web service's WSDL service description). One practical reason to use a format extension is if your web service requires a SOAP extension that runs at both the server and the client end. By default, no information about SOAP extensions is added to the service description, meaning that clients may not be aware that they need to use a given extension (for example, a security or encryption extension) before they can use the web service.
2)The System.Web.Configuration Namespace :
The System.Web.Configuration namespace includes a few miscellaneous types used in ASP.NET configuration with the web.config file; AuthenticationMode, FormsAuthPasswordFormat, and FormsProtectionEnum are all involved in ASP.NET security services. It also provides a ClientTargetSectionHandler class, which provides the basic functionality for processing tags in the web.config file, and HttpCapabilitiesBase, which stores a collection of client browser information used by the System.Web.HttpBrowserCapabilities class.
If you've explored the machine.config file, you have probably noticed that many other types referenced there don't appear in the ASP.NET reference (including configuration types like HttpCapabilitiesSectionHandler and AuthenticationConfigHandler). These private types aren't available to the client programmer and are part of the low-level ASP.NET infrastructure. Figure 24-1 shows the types in this namespace
3)The System.Web namespace :
It contains some of the fundamental ingredients for ASP.NET applications.
These ingredients include the classes used for the original built-in ASP objects (Request, Response, Application, and Server),
as well as classes for managing cookies, configuring page caching, implementing tracing, and retrieving information about the web server and client browser.
Aside from the classes required for web services and the Web Forms user interface,
the System.Web namespace contains the heart of ASP.NET's functionality.
4)The System.Web.Services Namespace:
The System.Web.Services namespace is the starting point for creating web services.
It contains a WebService class that custom web services can inherit from and the WebMethodAttribute and WebServiceAttribute,
which are used to mark web service classes and methods and add additional information.
Most types in other web service namespaces are used seamlessly by the .NET framework and are not used directly by the .NET programmer
The System.Web.Services namespace contains the types used for creating web services.
5)The System.Web.Caching Namespace:
The System.Web.Caching namespace includes types used for ASP.NET caching.
The Cache class is the focal point of this namespace;
it contains a collection of cached objects and allows you to set expiration policies and dependencies for each item in the cache.
The CacheDependency class encapsulates a cache dependency and allows you to link the validity of a cache item to another item or a file on the web server.
The CacheItemRemovedCallback delegate allows you to respond when an object is dropped from the cache. Both types work in conjunction with the Cache class.
Together, they allow you to implement sophisticated data caching.
6)The System.Web.Hosting Namespace:
The System.Web.Hosting namespace is not used in ASP.NET web applications;
instead, it provides support for hosting the ASP.NET service outside of Internet Information Services (IIS) in a custom hosting application
The two important classes in this namespace are ApplicationHost and SimpleWorkerRequest.
The other classes provide lower-level framework support and are not used directly in an application.
7)The System.Web.Security Namespace:
The System.Web.Security namespace includes the modules that implement various types of ASP.NET authentication,
such as WindowsAuthenticationModule, FormsAuthenticationModule, and PassportAuthenticationModule.
You don't interact directly with these modules in an ASP.NET application; instead,
the ASP.NET framework uses the appropriate module (based on the options you have set in the web.config file) to authenticate the user.
After this point, ASP.NET provides identity information in the System.Web.HttpContext.User property and
uses this identity to authorize access to resources such as files and URLs
8)The System.Web.Mail Namespace :
The System.Web.Mail namespace allows you to send email messages from your ASP.NET application.
This capability uses the built-in SMTP service included with IIS, and is similar to the CDO component used in traditional ASP development.
The SMTP service maps its Inbox and Outbox to directories on the server.
Message transfer is handled so that the Outbox is always empty and the Inbox never has an incoming queue.
9)The System.Web.SessionState Namespace:
The System.Web.SessionState namespace provides the types used for session state management,
which stores information that is specific to one session or client.
Each user accessing an ASP.NET application has a separate session state collection.
Session state is ideal for sensitive data (like credit card numbers and mailing addresses) because it is stored exclusively on the server.
It is also well suited for complex data (like recordsets, .NET class instances, or COM objects) that cannot be easily serialized to a client-side cookie.
10)The System.Web.UI Namespace :
The System.Web.UI namespace provides types that allow you to create controls and Web Forms (.aspx pages).
Many of these types provide support for controls in the System.Web.UI.HtmlControls and System.Web.UI.WebControls namespaces and are not used directly in your code.
Some of these types provide parsing, data binding, and template functionality.
The System.Web.UI namespace also includes a number of fundamental classes like Control (the base class for all HTML, Web, and user controls),
Page (the base class for every .aspx Web Forms page you create), and UserControl (the class representing all .ascx user controls).
11)The System.Web.UI.WebControlsNamespace:
The System.Web.UI.WebControls namespace contains types used for web controls.
Web controls are ASP.NET's most full-featured controls and range from straightforward elements like Button to sophisticated controls like Calendar, AdRotator, and DataGrid. Web controls are more abstract than HTML controls. Rather than wrapping specific HTML elements, web controls can consist of a combination of HTML elements and vary their user interface depending on the capabilities of the client browser. They also provide a richer set of formatting properties and events. For example, all input controls provide an AutoPostback property that, when set to True, allows your code to react immediately to a Change event (like a checkbox being checked or a new list selection).
This namespace contains the WebControl class, which is the base class for all web controls. Web controls include traditional standards like TextBox, Button, RadioButton, and CheckBox, and more unusual and advanced controls like Calendar, AdRotator, and the list controls CheckBoxList and RadioButtonList.
1)The System.Web.Services.Configuration Namespace :
The System.Web.Services.Configuration namespace contains three .NET attributes that are useful if you want to add custom format extensions to your web services (in other words, if you want to insert additional XML
elements to your web service's WSDL service description). One practical reason to use a format extension is if your web service requires a SOAP extension that runs at both the server and the client end. By default, no information about SOAP extensions is added to the service description, meaning that clients may not be aware that they need to use a given extension (for example, a security or encryption extension) before they can use the web service.
2)The System.Web.Configuration Namespace :
The System.Web.Configuration namespace includes a few miscellaneous types used in ASP.NET configuration with the web.config file; AuthenticationMode, FormsAuthPasswordFormat, and FormsProtectionEnum are all involved in ASP.NET security services. It also provides a ClientTargetSectionHandler class, which provides the basic functionality for processing tags in the web.config file, and HttpCapabilitiesBase, which stores a collection of client browser information used by the System.Web.HttpBrowserCapabilities class.
If you've explored the machine.config file, you have probably noticed that many other types referenced there don't appear in the ASP.NET reference (including configuration types like HttpCapabilitiesSectionHandler and AuthenticationConfigHandler). These private types aren't available to the client programmer and are part of the low-level ASP.NET infrastructure. Figure 24-1 shows the types in this namespace
3)The System.Web namespace :
It contains some of the fundamental ingredients for ASP.NET applications.
These ingredients include the classes used for the original built-in ASP objects (Request, Response, Application, and Server),
as well as classes for managing cookies, configuring page caching, implementing tracing, and retrieving information about the web server and client browser.
Aside from the classes required for web services and the Web Forms user interface,
the System.Web namespace contains the heart of ASP.NET's functionality.
4)The System.Web.Services Namespace:
The System.Web.Services namespace is the starting point for creating web services.
It contains a WebService class that custom web services can inherit from and the WebMethodAttribute and WebServiceAttribute,
which are used to mark web service classes and methods and add additional information.
Most types in other web service namespaces are used seamlessly by the .NET framework and are not used directly by the .NET programmer
The System.Web.Services namespace contains the types used for creating web services.
5)The System.Web.Caching Namespace:
The System.Web.Caching namespace includes types used for ASP.NET caching.
The Cache class is the focal point of this namespace;
it contains a collection of cached objects and allows you to set expiration policies and dependencies for each item in the cache.
The CacheDependency class encapsulates a cache dependency and allows you to link the validity of a cache item to another item or a file on the web server.
The CacheItemRemovedCallback delegate allows you to respond when an object is dropped from the cache. Both types work in conjunction with the Cache class.
Together, they allow you to implement sophisticated data caching.
6)The System.Web.Hosting Namespace:
The System.Web.Hosting namespace is not used in ASP.NET web applications;
instead, it provides support for hosting the ASP.NET service outside of Internet Information Services (IIS) in a custom hosting application
The two important classes in this namespace are ApplicationHost and SimpleWorkerRequest.
The other classes provide lower-level framework support and are not used directly in an application.
7)The System.Web.Security Namespace:
The System.Web.Security namespace includes the modules that implement various types of ASP.NET authentication,
such as WindowsAuthenticationModule, FormsAuthenticationModule, and PassportAuthenticationModule.
You don't interact directly with these modules in an ASP.NET application; instead,
the ASP.NET framework uses the appropriate module (based on the options you have set in the web.config file) to authenticate the user.
After this point, ASP.NET provides identity information in the System.Web.HttpContext.User property and
uses this identity to authorize access to resources such as files and URLs
8)The System.Web.Mail Namespace :
The System.Web.Mail namespace allows you to send email messages from your ASP.NET application.
This capability uses the built-in SMTP service included with IIS, and is similar to the CDO component used in traditional ASP development.
The SMTP service maps its Inbox and Outbox to directories on the server.
Message transfer is handled so that the Outbox is always empty and the Inbox never has an incoming queue.
9)The System.Web.SessionState Namespace:
The System.Web.SessionState namespace provides the types used for session state management,
which stores information that is specific to one session or client.
Each user accessing an ASP.NET application has a separate session state collection.
Session state is ideal for sensitive data (like credit card numbers and mailing addresses) because it is stored exclusively on the server.
It is also well suited for complex data (like recordsets, .NET class instances, or COM objects) that cannot be easily serialized to a client-side cookie.
10)The System.Web.UI Namespace :
The System.Web.UI namespace provides types that allow you to create controls and Web Forms (.aspx pages).
Many of these types provide support for controls in the System.Web.UI.HtmlControls and System.Web.UI.WebControls namespaces and are not used directly in your code.
Some of these types provide parsing, data binding, and template functionality.
The System.Web.UI namespace also includes a number of fundamental classes like Control (the base class for all HTML, Web, and user controls),
Page (the base class for every .aspx Web Forms page you create), and UserControl (the class representing all .ascx user controls).
11)The System.Web.UI.WebControlsNamespace:
The System.Web.UI.WebControls namespace contains types used for web controls.
Web controls are ASP.NET's most full-featured controls and range from straightforward elements like Button to sophisticated controls like Calendar, AdRotator, and DataGrid. Web controls are more abstract than HTML controls. Rather than wrapping specific HTML elements, web controls can consist of a combination of HTML elements and vary their user interface depending on the capabilities of the client browser. They also provide a richer set of formatting properties and events. For example, all input controls provide an AutoPostback property that, when set to True, allows your code to react immediately to a Change event (like a checkbox being checked or a new list selection).
This namespace contains the WebControl class, which is the base class for all web controls. Web controls include traditional standards like TextBox, Button, RadioButton, and CheckBox, and more unusual and advanced controls like Calendar, AdRotator, and the list controls CheckBoxList and RadioButtonList.
6 Comments:
Hey Thankyou Very Much.........Very useful Information for Beginner
This is a nice article..
Its easy to understand ..
And this article is using to learn something about it..
c#, dot.net, php tutorial, Ms sql server
Thanks a lot..!
ri80
Hi, I am very thankful. I want important list of namespace, not only in web forms but also for wpf and others
Sure i will explain the remaining namespaces ,especially for wcf.....Thanks for sharing
Sure i will explain the remaining namespaces ,especially for wcf.....Thanks for sharing
nice post, thanks for sharing
Post a Comment
Subscribe to Post Comments [Atom]
<< Home