Some discussions about ASP. NET code separation

Source: Internet
Author: User

About ASP. NET code separation code-behind:

Visual Studio. NETVS. NET) provides a very intuitive Web development environment for Visual Basic developers. VB developers have been accustomed to dragging and dropping their visual interfaces to the design interface for many years, and then double-click this element when they need to write code to control an element. I think. NET's greatest achievement is that it has adopted the Windows software design and information loop model message loop paradigm) and mapped them to stateless environments like Web. Once you write the application to be delivered, you will find that the ing is not perfect, but. NET can bring Windows programmers into Web development quickly is definitely worth noting.

Of course, many Web programmers use Visual Interdev, Visual Notepad, or other Web development tools to compile the dynamic Server Page (Active Server Page ). Many of these programmers had a hard time changing to the VS. NET World. They used to split their applications into a series of ASP pages, which encapsulate the visual interface and its behavior at the same time.

If you look at a lot. NET is also used by ASP developers in the beta stage to use the Framework SDK in. NET before the official launch) written code example, you can see the main line inline) code example. This is because they still write code according to the habits of ASP development. In fact, one of the first major ASP. NET applications that developers can obtain is the iBuySpy Portal and Store. These applications are presented to VB. NET and C # developers in the form of code separation at the time of publication, and are still implemented in a single-page ASP. NET. Many developers who prefer a single file ASP. NET application use iBuySpy as a way to continue to compile intra-row code.

What are the advantages of ASP. NET code separation?

Every. NET development organization that uses ASP. NET for development will encounter some problems: do we use C # Or VB. NET as our core development language? Do we need to standardize ASP. NET development in the industry, or strictly enforce the use of code separation files? The answer to the first question depends on the experience and habits of the original developers, because using a familiar language will minimize the cost of your training and language adaptation. However, the argument about code separation is not clear. Although some references insist that code separation is the correct way to Develop ASP. NET applications, I have not seen any suggestions on this point in Microsoft's documents. So how do you decide?

ASP. NET code separation-schema debate

From the perspective of structure, code separation files allow more concise system implementation. Code separation files allow developers to separate the display of the UI from the UI processing. Only codes in the ASPX file can be used for service display. Re-use code in a file with code separation is easier than in a single file with code in the line, though it is still not simple ). Separating design and development functions is also possible. You only need to allow the designer to use the ASPX file and Encoder for code separation development. It is much more difficult to implement this with in-line code.

ASP. NET code separation: an environmental debate

Although VS. NET allows you to use in-line code to create an application, it is much more intuitive to use code separation files to abstract the lower-layer UI processing model. When you use code separation instead of writing in-line code, the compiler can also perform type checks and allow full intelliisense. It is also possible to conduct an application that has errors in the code in the row, which can only be performed before the final code is executed. When you compile this application, the same code containing errors in the code separation file will be intercepted.

Is the intra-row code of ASP. NET code separation used correctly?

I have already listed two main arguments about using code to separate files. I would like to point out below two possible cases of using line-by-line code to make it fair.

The content of ASP. NET code separation is introduced to you here, hoping to help you understand ASP. NET code separation technology.

  1. Example of ASP. NET dataset usage
  2. Analysis on ASP. NET data type conversion
  3. Analysis of validation groups in ASP. NET data verification
  4. Analysis on the use of ASP. NET data verification controls
  5. Analysis on five common controls for ASP. NET data verification

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.