ASP. NET naming settings

Source: Internet
Author: User

When talking about ASP. NET naming settings, do not use the default name when using Visual Studio. NET, except for directly or non-referenced objects.

One of the benefits of. NET is that all source code and configuration files are plain text files and can be edited using any text editor such as Notepad or WordPad. If you do not want to, we do not have to use Visual Studio. NET as the integrated development environment. However, with Visual Studio. NET, we can see the file in Windows File Manager or browse the file content from a text editor outside Visual Studio. NET.

Using Visual Studio. NET as an integrated development environment has many advantages, of which the most significant advantage is that it greatly improves production efficiency. With Visual Studio. NET, we can develop software faster at a low cost. As part of the integrated development environment, intelliisense provides Automatic Code Completion, dynamic help when entering methods or functions, real-time syntax error prompts, and other functions that can improve production efficiency.

Learn and use ASP.. NET skills, like other complex tools, before learning how to give full play to its role and master its "habits", Visual Studio. NET will also make us feel frustrated. Sometimes, it is like a hard-to-understand black box, it will generate a large number of files and a lot of useless code.

One function of Visual Studio. NET is to provide a default name for a new object, whether it is an object in a class, control, or form. For example, if we create a new ASP. NET Web Application, the default name is WebApplication1. In the "new project" dialog box, we can easily change the name of the application, but only the name of the application's namespace and its virtual directory are changed, the default names of source code files are still WebForm1.aspx and WebForm1.aspx. csC # project) or WebForm1.aspx. vbVB.. NET project ).

We can change the file names used by ASPX and code in the solution browser, but the webpage class name will still be WebForm1. If a button is generated on the Web form, the default name is button1. In fact, the names of all controls are composed of the control type and number.

We can also change the names of all forms and controls in the application to meaningful names. For a small demo program, the default name is also competent, but if the application consists of multiple forms, each form contains many buttons and labels, form names such as frmStartup, frmDataEntry, and frmReports are easier to understand and maintain than Form1, Form2, and Form3.

If the form control needs to be referenced elsewhere in the code, it is more important to have a meaningful name. The names such as btnOK, btnCancel, and btnPrint make it easier for code users to understand and maintain controls such as Button1, Button2, and Button3.

Apply ASP. NET tip a good way to modify a name that appears in all files in a project is in Visual Studio. in the. NET menu, select "edit"-& gt; "discover and replace"-& gt; "replace.

When looking at the code we wrote two weeks ago, we often see the code for the first time, so it is necessary to make them have a name that helps us understand its meaning.

I will introduce you to the basic situation of ASP. NET naming settings. I hope this will help you understand ASP. NET naming settings.

  1. Analysis of ASP. NET database programming technology
  2. Miscellaneous on the learning path of ASP. NET programmers
  3. Analysis on the advantages of ASP. NET in eleven aspects
  4. Analysis on ASP. NET database connection pool settings
  5. How to Learn the nine steps of ASP. NET

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.