Introduction to ASP.NET XML

Active Server Pages .NET (ASP.NET) is a new technology that is used to create dynamic Web pages. You can combine these Web pages to form a data-driven Web site that accesses data from a data source. You will learn about dynamic Web pages in detail in the later section titled "Dynamic Web Pages."

ASP.NET is evolved from the Active Server Pages (ASP) 3.0 technology, which has been used over the years to create Web pages. ASP allows you to create dynamic Web pages easily and quickly. Therefore, ASP.NET allows you to create scalable, dynamic, and interactive Web pages by using any of the .NET languages, such as Visual Basic .NET (VB.NET), Visual C#, and so on.

Features of the ASP.NET Technology

As stated earlier, the ASP.NET technology extends full support to the .NET initiative. As a result, the Web services that you create using ASP.NET benefit from the .NET technology. We will now discuss some of the features of the ASP.NET technology:

  • Create Web pages using any of the .NET languages. The .NET platform includes several programming and scripting languages, such as Visual Basic .NET, Visual C#, Visual FoxPro, and JScript .NET. Therefore, you can create Web pages by using any of these languages or a combination of one or more languages. Although it's not possible to use more than one language on the same page, a Web site can contain Web pages written in different languages.

For example, the programmers who develop applications in Visual Basic can use Visual Basic .NET to develop Web pages. Similarly, the programmers who work in C++ or VC++ can use Visual C# or managed extensions in Visual C++ .NET to develop Web pages. Various .NET languages that you can use to create ASP.NET applications are shown in Figure.

NET Languages Used to Create ASP.NET Applications

NET Languages Used to Create ASP.NET Applications

  • Compile the ASP.NET code easily. Code that is written using any of the .NET languages is compiled as managed code by using the Common Language Runtime (CLR). The CLR ensures safe and efficient execution of code.
  • Support .NET base classes. ASP.NET is a component of the .NET Framework. Therefore, you can use the classes contained in the .NET base class library to perform versatile operations in ASP.NET Web pages. For example, the .NET class library contains a Thread class that you can use to include threads in a Web application. Similarly, the Exception class of the .NET class library can be included to raise exceptions in the application.
  • Provide server controls. ASP.NET Web applications are created in Visual Studio .NET, which provides you with a wide range of server controls. You can use these controls to create your own Web pages. The server controls that ASP.NET Web applications support are shown in Figure. You will learn about these controls in detail in the later section titled "Web Form Controls."

Server Controls that ASP.NET Web Applications Support

Server Controls that ASP.NET Web Applications Support

  • Allow customization of Web pages. You can also customize Web pages according to user's preference. For example, ASP.NET allows you to change the appearance of a page, such as the layout of the page, the controls in the page, and so on, according to users' preferences. In addition, you can store information in a database or an XML file about the users who access the Web page.
  • Separate the code from the programming logic. The Web applications that you create using ASP.NET contain an .aspx file. This file contains the HTML code for the application. In addition, the application includes an .aspx.vb or .aspx.cs file that contains the programming logic of the application. This implies that the HTML code and the programming logic of the application are stored in separate files.

Note?/td>
The .aspx.vb file is formed if you create a Web application by using Visual Basic .NET. Similarly, if you use Visual C#, a file with the extension .aspx.cs is created.

  • Customize the Web page according to the browser used. You can view ASP.NET pages on several browsers. However, while you're designing a Web page, you don't need to worry about the browser used. ASP.NET customizes the Web page according to the browser settings.
  • Allow the creation of Web services. The ASP.NET technology allows you to create Web services, which is an important feature of the .NET Framework.
  • Configure applications by using IIS. You can configure ASP.NET applications by using Internet Information Server (IIS). In addition, you can configure the applications by using the Web.config file.

Architecture of ASP.NET Applications

When you create ASP.NET applications in Visual Studio .NET, it creates several default files. These files have different file names and extensions. For example, Visual Studio .NET creates a user interface, a file that contains the code for the user interface, reference files, a file containing the programming logic of the application, and so on. You will learn about these files in detail in the section "Default Files in a Web Application."

In addition to the files containing the code, an ASP.NET application consists of the directives and the layout of the application. The following list discusses the components of an ASP.NET application:

  • Code The code of an application is written to implement the business logic of the application. A code for an application includes namespaces, classes, methods, and so on. After writing the code for an application, you can reuse the code in other applications.
  • Layout. The layout forms a template of the application, as it would appear on the browser.
  • Directives. Directives are used to provide additional information about the Web page, such as the language used and the resources required in a transaction. In addition, you can use directives to insert messages for the compiler and the browser. As you know, the ASP.NET technology creates dynamic Web pages. We will now briefly discuss the types of Web pages.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

XML Topics