ASP (former) vs ASP. NET (later)
Prelude
Review ASP history:
In the era without ASP, people are not satisfied with static pages. ThenCGI (Common Gateway Interface, Common Gateway Interface)AndISAPI (Internet server application program interface, Internet server applicationProgramInterface)To compile dynamic pages. Written in Perl or VC and embedded in HTMLCode......
At this time, ASP appears ...... It can directly embed code into HTML, and also use built-in components (suchADO: ActiveX Data Objects. Its appearance brings a boom in website development ......
(1) Asp 1.0: it is sent free of charge as a subsidiary product of IIS, and its external components need to be instantiated.
(2) Asp 2.0: when combined with IIS 4.0, it is possible to establish an ASP application. Each component has its own memory space and is builtMTS (Microsoft Transaction Server)It also makes it easy to create components.
(3) Asp 3.0: with Windows 2000 and IIS 5.0. It is not a simple extension of ASP. It has made great improvements in the core and handed over many things.COM (Component Object Model, Component Object Model). Microsoft developed COM + in combination with the Core Environment of MTS and COM, which allows the host to use components in a new way.
Later, ASP. NET emerged. It is not a simple upgrade of ASP ......
Body
<1> Asp vs ASP. NET
ASP only accepts VBScript, and JavaScript is the programming language. It cannot be performed like a traditionalProgramming LanguageSuch underlying operations can only be written in C ++, VB, Java, and other languages.
ASP. NET supports any compilationMsil (Microsoft intermediate language)The language of the program.CLR (Common Language Library)ASP. NET can be compiled in standard languages. Currently, there are three main types:
(1) VB. NET: replaced the VB script with weak functions, which was improved by VB6;
(2) C #: Adapted from the C ++ language;
(3) JScript: improved by JavaScript;
(J # I haven't used it yet, and it died in vs2005. I just switched to cloud ^_^)
Additional:
Msil is an intermediary language between high-level languages (such as VB) and machine code. net, the program language we wrote will first be compiled into msil, and then msil will be compiled into machine code for execution. Process 1:
The msil program is very similar to the machine code, and it is very fast to compile and execute machine code from msil. The Compiler between msil and machine code is calledJIT (Just In Time)The JIT compiler of different machines enables msil to be compiled into different machine codes in a timely manner and then executed on different machines. 2:
No matter which language ASP.. net, the developed components will be compiled into msil. Therefore, no matter which program language the web developer uses, these components can be used, in this way, resources are shared and cost-effective.
<2> Asp vs ASP. NET syntax
In ASP, the collection returned by request, request. querystring, and request. form is of the string array type;
In ASP. NET, the collection returned by request, request. querystring, and request. form is of the string type;
<3> Asp vs ASP. NET Semantics
(1)
ASP allowsSINGLE PAGEUsed inMultiple LanguagesDevelopment, which is useful for the script library solution;
ASP. NETSINGLE PAGEOnly supportedSingle languageDevelopment (because ASP. NET needs to be compiled to run), but different languages can be used in the same project. (User controls can be used to integrate different languages on a single page)
(2)
Functions declared in ASP are marked with <%> and page rendering functions are supported, such as: <% = now %>;
Functions declared in ASP. NET must be in the <SCRIPT runat = Server> </SCRIPT> mark, and ASP. NET does not support page rendering functions;
<4> Asp vs ASP. NET execution
ASP is interpreted and executed. WhenASP Webpage (suffixed with. asp)When viewed, IIS starts ASP. DLL for execution.
ASP. NET is compiled and executed, and it is the compiled CLR code on the running server. WhileASP. NET webpage (suffixed with. aspx)When viewed, IIS startsW3wp.exe (or aspnet_wp.exe, or xspwp.exe).
Because they have different execution files, the installation of ASP. net not only does not affect the operation of existing ASP Web pages, but also ASP Web pages and ASP. NET web pages can coexist in one website.
<5> Asp vs ASP. NET Efficiency
ASP. the execution process of net has one more compilation process. the first time a Web page is executed, it will be slower than ASP. However, after being browsed for the first time, msil will be stored. Therefore, when a Web page is browsed for the second time, it only takes time from msil compilation to machine code execution, and the result is much faster than ASP. Comparison:
Time used to view the second ASP. NET web page <time used to view the ASP. NET web page <time used to view the first ASP. NET web page
<6> Asp vs ASP. NET Interface
Before. NET Framework is released:
(1) ASP is based on ASP. the object provided by DLL is an interface; (Asp. DLL provides very limited objects such as application, session, request, response, and server, ASP programs can obtain form data, read system information, output to browsers, reference ActiveX objects, and so on .)
(2) Applications Use Win32 APIs and COM objects as interfaces;
After the. NET Framework is released:
Both ASP. NET and applications use class libraries provided by. NET Framework as interfaces.
See Figure 3:
After ASP. NET, all the objects provided by the original ASP. dll are transferred to a small part of the. NET Framework class library. The. NET Framework Class Library provides hundreds of classes. ASP. NET web development can be like a Windows program, using a very powerful. NET Framework class library makes web development very convenient.
To view the classes provided, open the. NET Framework SDK file and find the. NET Framework reference, which lists all the classes and their usage instructions.
Please give us some advice. Pai_^