2.1 From ASP to ASP. NET

Source: Internet
Author: User
Tags server installation and configuration web database

2.1.1 ASP
ASPActive Server Pages (Active Server Pages) is a technology that Microsoft launched with its IIS 1996 in 3.0 for Web Server application development, it provides a server-side scripting environment that uses VBScript or JScript to create and run dynamic and interactive Web server applications.
ASP server script program is embedded in HTML, which is directly interpreted and executed by the execution engine asp. dll. ASP supports object-oriented features and extends ActiveX Server Components. ASP makes it easy to use ADO components to access databases and create Web database applications. Therefore, ASP has been widely used in Web Application Development since its launch.
The suffix of the ASP program is. asp. An ASP file is equivalent to an executable file. Therefore, it must be placed in a directory with executable permissions on the Web server. When a browser requests an ASP file from the Web server, the Web server responds to the HTTP request, calls the ASP engine, and interprets the file to be applied. When you encounter scripts VBScript and JavaScript compatible with Active X Script, the ASP engine calls the corresponding Script Engine for interpretation. If the script instruction involves access to the database, it is connected to the background database through the database engine. The database access component performs operations on the database, dynamically generate an HTML page from the execution result and return it to the Web server. Then, combine the result with the non-scripting HTML on the page into a complete HTML page and send it to the client browser. Therefore, the client browser receives a pure HTML file generated after execution by the Web server, which can be executed by any browser running on any platform. The execution process of ASP is 2-1.

 

Figure 2-1 ASP program execution process

The following is a Simple ASP file named Simple. asp:
<Html>
<Head> <Title> ASP example </Title> </Head>
<Body>
<% Response. Write ("Hello! ") %>
</Body>
</Html>
The Response. Write defined by the delimiters "<%" and "%>" Hello! ") Is the ASP script code on the server. If the file is stored in the Web site directory of the IIS server, enter http: // localhost/Simple. asp in the address bar of the browser to start the program. For IIS Server installation and configuration, see section 1.5.2.
ASP is easy to use and powerful, but it has some shortcomings, mainly including the following:
1) lack of good development models and programming languages. ASP lacks component-based and event-driven development models. It only supports Script and VBScript languages with relatively weak functions.
2) The program structure is unclear. ASP's server-side script program code, client program code, and HTML Tag are mixed, and the program structure is unclear. The program is difficult to maintain, and it is difficult to troubleshoot.
3) difficult to deploy COM components. If the COM component is used in the ASP program, you must first register the component information, such as the component file location and identification code, to the system registry.

2.1.2 ASP. NET
ASP. NET is a major upgrade and update to the traditional ASP technology, it is built in. the programming framework on the public Language Runtime Library of the. NET framework can be used to generate powerful Web applications on the server. Compared with the previous Web development model ASP, ASP. NET has the following outstanding advantages:
1. Enhanced Performance
ASP. NET programs run the compiled Common Language Runtime Library CLR on the server, rather than interpreting and executing the code as ASP does. In addition, ASP. NET can improve program execution performance by using early binding, real-time compilation, local optimization, and cache services. Compared with ASP, ASP greatly improves execution efficiency.
2. Development Tool support
ASP. NET applications can be developed with Microsoft's latest product development tool Visual Studio. NET. Visual Studio. NET adds a large number of toolbox and designer compared with the integrated development environment of Visual Studio to support Visual development of ASP. NET applications and wysiwyg wyg wysiwyg wywyg. Using Visual Studio. NET for ASP. NET application development can greatly improve program development efficiency and simplify program deployment and maintenance.
3. multi-language support
ASP. NET is language-independent), that is, no matter which language is used for programming, it will be compiled into an intermediate language. Therefore, the designer can choose a language that he thinks is the most suitable for programming, or write programs in multiple languages. Currently, ASP.. NET supports C # and VB. NET, JScript. NET, and some other partners also provide development services.. NET applications, such as Cobol, Pascal, Perl, and Smalltalk.
4. Efficient manageability
ASP. NET uses a text-based and hierarchical configuration system to simplify the configuration of server environments and applications. Because the configuration information is saved in simple text, the new settings can be implemented without starting the local administrator tool. This is called "Zero Local Administration ". To install an ASP. NET application on a server system, you only need to simply copy some necessary files without restarting the system.
5. scalability and availability
ASP. NET has been designed with Scalability considerations and added a feature specifically designed to improve performance in a clustered and multi-processor environment. In addition, the process is affected by ASP. NET Runtime Library, so that when the process behavior is not often exposed, deadlock), you can create a new process to help keep the application always available for processing requests.
6. customization and scalability
In ASP. NET design, developers can define the plug-in module in code, that is, ASP. NET can add any custom components. In fact, you can use your own custom components to expand or replace any sub-components of the ASP. NET Runtime Library.
7. Security
With built-in Windows Authentication and configuration based on each application, you can ensure that the application is secure.
8. Clear program structure
ASP. NET uses event-driven and data-bound development methods to completely separate program code from the user interface, with a clear structure. In addition, Code-Behind can be used to separate program Code from user interface tags in different files to make the program more readable.
In addition, ASP. NET has high compatibility with ASP applications, which ensures the migration of ASP programs to ASP.. NET environment, of course, some of the original programs may need to be modified properly.
It can be seen that ASP. NET has outstanding advantages over ASP and will become the mainstream platform for Web application development.
It should be noted that the database access is ASP. NET applications, so in ASP. NET applications often involve the processing of database tables, mainly using data controls and related program code to achieve database access and data display. Processing of database access in ASP. NET applications is one of the highlights of this book, which will be detailed in chapter 7th.


BibliographyPrevious sectionNext section

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.