ASP.NET is a part of the Microsoft .NET Framework. The dot net framework is a software framework developed by the Microsoft company in 2002. The dot net framework provides a common platform to run (execute) applications created in different programming languages. That is, it is a framework with which Windows applications and Web applications can be easily created and run. You will use the features of the .NET Framework to create ASP.NET pages. It has two parts:

  • Framework library
  • Common language runtime.

The Framework Class Library

The .NET Framework consists of thousands of classes that are used to build applications. The framework class library is designed to make programming tasks easier. Following are some examples of framework classes.

  • File class: File class helps to display a file on a hard drive. It is used to check the presence of files (Create new files, Delete files), and to perform many file-related tasks.
  • Graphics class: Graphics class works with different types of images such as GIF, PNG, BMP, and JPEG images. It is used to make a square, rectangular shape, circle-shaped, figures, and other elements of the picture.
  • Random class: A random number is produced in a random class.
  • SMTP client class: E-mail is sent from the SMTP client class. It also goes to those emails, which also have a list of attachments and HTML content.

This is just an example of only four classes of the framework. The .NET Framework has around 13,000 classes that you can use to build applications. All the classes in this framework can be accessed by expanding the SDK documentation and class library nodes of the Microsoft.NET Framework ( Ctrl + WJ).

Note: Microsoft's framework includes types, classes, public methods, public properties, and public events.

Each class of the framework can include properties, methods, and events. Properties, methods, and events revealed by a class are members of the class. For example, members of the client class are given a partial list here.


  • Host - The name or IP address of your e-mail server
  • Port - The number of the port to be used when sending e-mail messages


  • Send- This allows sending email messages with contemporaneity.
  • SendAsync - This allows e-mail messages to be sent indefinitely.


  • Send Completed - This event arises when the task of sending an e-mail is completed.

If you know the members of the class, you can do any work with the class. For example, the Smtp Client class has two properties: host and port that can help you use the e-mail server while sending the e-mail as you wish. Does.

The methods send () and sendAsync () of the Smtp Client class are also helpful in sending e-mail. The send method stops further execution of the program until the send operation is completed. The sendAsync () method, on the other hand, sends e-mail. Like the send () method, the send sync () method does not wait for the send operation to complete.

An event in the send client class is Send completed that arises when the re-sending function is finished. You can also create an event handler for this, which shows a message when the e-mail is gone.

The list shows how to send an e-mail using the Smtp client class using its send () method.

Protected sub page_ Load (By Val sender As Object, By Val e As system. EventArgs)

                  Dim client As New System.NET.Mail.SmtpClient()

                  Client.Host = “


client.Send(“”,””, “Text message”,”Hello friend”)

End Sub


The page in the list calls the Smtp client Send () method to send e-mail. The first parameter is formed: address; The second parameter to address; The third parameter is the subject, and the parameter is the body of the email.

Caution: Pages in this list send e-mail using the local Smtp server. If your Smtp server is not capable then you will get an error message that will give a remote host- "An existing connection was forcibly closed." You can make your Smtp server capable by opening Internet Information Service, then right-clicking Default Smtp Virtual Server (Virtual Server), and choosing Start.


The .NET Framework has approximately 13,000 classes. This is a very large number. If Microsoft classifies these into different namespaces. A namespace is usually a class. For example, all the classes associated with the file system are located in the system.IO namespace. The class associated with Microsoft SQL Server exists in the system.Data.SQL client namespace. Before using the class on the page, it is necessary to name its namespace. There are many ways to do this.

First, you will name the class with its namespace. For example, the file class is part of the system.IO namespace, so you can use the following code to check it. Whether the file exists or not:


Each time using a namespace with a class name becomes tedious (this involves excessive typing) another way to do this is to import the namespace. To import a particular namespace, add a <% @ import%> directive to the page. In the above list, we have imported the system.Net.Mail namespace as Smtp Client is part of it. In the above list, the following dative is used at the top of the page.

<%@import namespace =””%>

After importing a particular namespace, it is not necessary to place the namespace in front of the names of its classes. Finally, if you find that you are using namespace on many pages of your application, you can design all the pages of your application to identify the namespace.

Note: A web configuration file is a special type of file that you currently use to configure the application. Keep in mind that this file is an XML file, so all its elements are case-sensitive. To add a web configuration file to your application, select Website, add a new item, and add a web configuration file.

If you add the configuration file given in the above list to your application, you do not need to import the System.Net.Mail namespace to use the class. For example, if you include a Web. config file in your project, you can remove the <% @ import%> directive from the page in the following list.

You do not need to import all namespaces. In the ASP.NET framework, you can use the most commonly used classes for free. Here is the namespace:

  • System
  • Collections
  • Collections.Specialized
  • Configuration
  • Text
  • Text.Regular.Expressions
  • Web
  • Web.Caching
  • Web.SessionState
  • Web.Security
  • Web.Profile


An assembly is a real .dll file on your high drive, where the .Net framework's class is stored. For example, all the classes in the ASP.NET framework are located in an assembly name System.web.dII. An assembly is the primary unit of security and version-control of the .Net framework. Because it extends to many files, it is also often called "logical" dll.

Note: The .Net Framework (version 2.0) has 51 assemblies. Assemblies are of two types: a private assembly that is used by only one application. The second shared assembly is used by all applications located on the same server.

Shared assemblies are located in the Global Assembly Cash (GAG). For example, the System.Web.dll and other assemblies that come with the .Net framework are located in the global assembly cache.

Note: The physical assembly cache is physically located in the \ Window | Assembly folder of the computer. Each assembly has a separate cap in the \ Window \ Microsoft.Net \ Framework \ folder. The first set of assemblies are used at run-time and the second set is used at cup-time.

You must add a reference to the class located in the assembly before using it in your application. By default, the ASP.Net application references all the assemblies, which are given in the GAC:

  •  Mscorlib.dll
  •  System.dll
  •  System.Configuration.dll
  •  System.web.dll
  •  System.Web.Services.dll
  •  Sytem.Xml.dll
  •  System.Drawing.dll
  •  System.EnterpriseServices.dll
  • System.web.Mobile.dll

To use a particular class in a .Net framework you will have two tasks. First, your application has to use a reference to the assembly in which the class is located. Second, your application has to import the namespace associated with the class.

In most situations, the reference to the assembly is not required, as most of the used assemblies refer to themselves. But to use a special assembly, a reference has to be made to it. For example, a class to be used for a reciprocal relationship with an active directory. For this, using the System. directory services namespace, you have to reference the system.Directoryservices.dll assembly in your application.

The .Net Framework SDK uses every class of documentation and namespace. For example, if you look at the message queue class in the documentation, you will find that the class is in the system.Messaging.dll assembly located in the System. Messaging namespace.

If you are using the Visual Web Developer, you can reference it in an assembly as follows: Select the menu option website "Add Reference", and select the name of the assembly to which the reference is to be referenced. For example, when you add a reference to the System.Messaging.dll assembly, the web configuration file in the following list is added to the application:


<clear />

<add namespace = "System" />

<add namespace = "System.Web.UI.WebControls" />

<add namespace = "System.Web.UI.WebControls.WebParts" />

<add namespace = "System.Web.UI.HtmlControls" />


If you visualize If you do not want to use the web developer, you can use System.Messaging.



I am an engineer by profession but being a blogger is my old day's dream to create my site for those who are more curious about my birthplace than I am coming from (India). the current city lives in Navi Mumbai, India

Post a Comment


Previous Post Next Post

نموذج الاتصال