Asp. NET Close-up

Source: Internet
Author: User
Tags advantage
asp.net ASP. NET Close-up

New technologies for creating dynamic Web pages have been rewritten on the basis of CLR services. So far, all. NET provides a language that can be used to write ASP.net pages, but the extension of the page is different from that of ASP 3.0. Specifically, a simple Web page with ". aspx" as the extension, a Web service with ". asmx" as the extension (from "Assembly"), a asp.net page reusable part called Pagelet with ". ASPC" as the extension.
. NET applications can run both. asp and. aspx pages smoothly. Legacy ASP pages will be run directly by Asp.dll, but it cannot take advantage of the capabilities of the CLR.

Now, the. aspx page no longer interprets execution, but is compiled into MSIL code when the first call occurs, and then runs in intermediate code, just like a JSP in the Java environment. A logical conclusion is that performance will improve, and Microsoft claims that it can match visual Basic 4 upgrades to a compiled version 5 o'clock application performance.

In addition to understanding all the new concepts introduced by vb.net, these fundamental changes require significant changes to the way ASP pages are written. To understand the work to migrate from ASP to ASP.net, let's analyze the main changes.

These changes are divided into three levels:

Changes in the API
Changes to the page structure
Changes between VB Script and vb.net
Asp. NET only allows each page to use one language. In DNA, ASP pages can use both JScript and VB script, but asp.net no longer allow this usage.

In asp.net, functions must be surrounded by HTML < SCRIPT > tags, and the function used to generate HTML code is not allowed to be split into parts. For example, ASP. NET does not allow the following code to appear:

Instead, we have to replace the following code:

< SCRIPT language= "VB" Runat=server >
Function SayHello ()
Response.Write ("< b >< i >")
Response.Write ("Hello!")
Response.Write ("</I ></b >")
End Function
</script >


Parentheses enclosing function call parameters are now required. In addition, some compatibility problems may originate from all ASP.net array subscripts starting at 0, while in ASP 3 some start with 0 and some from 1.

In vb.net, the parameter is passed by value (ByVal) by default, and in the current VB script, the parameter is passed by reference (BYREF) by default. Finally, VB. NET will no longer support default values or keyword set, let.

While these changes are not significant and fundamental, if you want to take advantage of the CLR and compile the code, you have to modify existing code, which can take up a lot of time for developers. Microsoft has announced that the tools for code migration will accompany. NET platform, but from now on to develop a suitable coding habits is undoubtedly beneficial to the harmless.

As for COM components, ASP. NET will be packaged so that the original COM components can still run, but these COM components will run outside of the CLR managed environment, and the switch between managed and unmanaged environments will sacrifice some performance. As a result, many users may decide to rewrite COM components as COM + 2.0.

Asp. NET introduces server-side controls, which may be an important reason why asp.net attracts developers to use it. Using these controls, ASP. NET page can take advantage of the following advanced services provided by visual or Non-visual controls: TreeView (tree view), ListBox (list box), Calendar (Calendar), and so on. All of these controls parse the client type that calls them, and then generate the appropriate presentation code. In general, input boxes in Web pages use client Java Script for validation of input legality, but if the browser does not support Java script or Java script is disabled, user input validation will go to the server side.



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.