Asp. The difference between the compilation and interpretation of Net and ASP

Source: Internet
Author: User
Tags execution new features
asp.net| Compilation | difference

Since the release of the. NET plan by Microsoft in June 2000, programming has caused an epoch-making revolution in the industry. Asp. NET is an important part of the. NET plan, and it provides many new features for Web application developers, including compiled server-side code, a code-behind technique that separates server-side logic from client layout (code-behind) technology, Extensible server-side control model, design data-binding model, XCOPY deployment, and form ID verification support on customers and servers.

Asp. NET as an advanced Web application development technology, compared with the ASP has a revolutionary progress. It uses the compiled language (including metadata, IL, and other resources), which is a major reason for the performance improvement of the. aspx file, and is also a significant asp.net different from previous ASP. Asp. NET load the page for the first time slower, but later load the page speed is not comparable to the ASP, its speed is fast. This is because ASP.net has the overhead of first accessing a Web page: loading the asp.net worker process, parsing the. aspx file and compiling it into an executable assembly. This is different from the ASP engine executing server code, because the ASP always gives the server code to the JScript or VBScript interpreter for parsing every time it executes.

Asp. NET is not technically called ASP 4.0, but in many ways it is the ASP 4.0 version. We can see the similarities between the. aspx file and the. asp file from the following two examples:

Example of a routine 1:aspx page

<!--file:test.aspx-->

<%@ Page language= ' C # '%>

<script runat=server>

int Add (int x, int y)

{

return x+y;

}

</script>

<body>

<table border=1>

<tr>

<td> two number of the sum is: </td><td><%=add (2,3)%></td>

</tr>

</table>

</body>

Example of a routine 2:asp page

<!--file:test.asp-->

<%@ language=jscript%>

<script language= ' JScript ' runat=server>

function Add (x,y)

{

return x+y;

}

</script>

<body>

<table border=1>

<tr>

<td> two number of the sum is: </td><td><%=add (2,3)%></td>

</tr>

</table>

</body>

The code for

As you can see from the illustration above, the assembly includes both server-side and static HTML statements, so that you have access to one for the first time. ASPX page, you can build the page later by just executing the compiled code. Is that asp.net pages are eventually compiled into. NET classes (components in the. NET Framework are also called classes), so it is not possible to use multiple server-side languages in an. aspx file, which solves all the inefficiencies associated with the traditional ASP scripting model. So say, ASP. NET is an upgraded version of ASP.

There are other benefits to using the compilation model than interpreting the model: 1, the model is better than the interpretation model in terms of performance. Because the compiler compiles web pages into classes (components), you can debug them with the same debugging tools that desktop applications or component developers use. 2, so that the application can be found at compile-time errors, so that the robustness of the application can be greatly enhanced. 3,. NET application developers can use all the tools that. aspx developers can use. All in all, from the traditional ASP over to ASP.net, is in the performance of the program, speed and other aspects of the revolutionary improvements.



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.