Asp. The ten techniques in net programming

Source: Internet
Author: User
In this document, we will discuss 10 techniques that programmers need to pay attention to when using ASP.net to develop applications that involve changes from the default controls, table Single-name to StringBuilder classes, and help programmers adapt as quickly as possible. NET environment.
??
? 1, in the use of visual Studio. NET, do not use the default name except for objects that are directly or not referenced.
??
? . NET, one of the benefits is that all source code and configuration files are plain text files that can be edited using any text editor such as Notepad or WordPad. If not, we are not necessarily using visual Studio. NET as an integrated development environment. But with Visual Studio. NET, we can see files in Windows File Manager, or in Visual Studio. NET to browse the contents of a file from a text editor.
? Use Visual Studio. NET as an integrated development environment has many benefits, the most notable of which is that it greatly improves productivity. Use Visual Studio. NET, we are able to develop the software faster with a small cost. IntelliSense, as part of the integrated development environment, provides automatic code completion, provides dynamic help when entering methods or functions, real-time hints of syntax errors, and other features that improve productivity.
? Like other complex tools, Visual Studio before learning how to give full play to its role and grasp its "habits". NET also gives us a sense of frustration. Sometimes it's like a black box that's hard to understand, generating a lot of files and lots of useless code.
? Visual Studio. NET is the ability to provide a default name for a new object, whether it is a class, a control, or an object in a form. For example, if we create a new ASP.net Web application, the default name will be WebApplication1. We can easily change the name of the application in the "New Project" dialog box, but at the same time change only the name of the application's namespace and its virtual directory, the source code file's default name is still WebForm1.aspx and WebForm1.aspx.cs (C # Engineering) or WebForm1.aspx.vb (vb.net engineering).
??
? We can change the file name used by ASPX and code in the scenario browser, but the name of the Web page class will still be WebForm1. If a button is generated on the Web form, the default name will be Button1. In fact, the names of all controls are made up of the type and number of controls.
? We can, and should, change the names of all the forms and controls in the application to meaningful names. The default name is also available for smaller demos, but if the application is composed of multiple forms, with many buttons and labels on each form, tables such as Frmstartup, Frmdataentry, and Frmreports are single-name more than Form1, Names like Form2 and Form3 are easier to understand and maintain.
? If a control on a form is to be referenced elsewhere in the code, it is even more important to have a meaningful name. Names such as Btnok, Btncancel, and btnprint make it easier for people looking at the code to understand, and therefore easier to maintain than controls named Button1, Button2, and Button3.
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.