ASP. NET annotation code is frequently used in actual programming and can be effectively used to display the function information and interpretation of the Code. Is there any usage skills for ASP. NET annotation? Let's take a look:
ASP. NET annotation is not applicable to ASP. NET, but it is a good programming habit.
Annotations should not only describe what operations the code performs, but also indicate the reason. For example, not just in comments, it indicates that the traversal array is to calculate a value based on an algorithm, unless the algorithm is quite simple, otherwise, the algorithm should be briefly described.
Different programming languages in the. NET project have different annotation symbols. To understand ASP. NET annotations, we also pay attention to other languages. The following is a brief description:
HTML & lt ;! -- Comment -- & gt;
JavaScript // Annotation
Vbscript' comment
VB. net' Annotation
C # // Annotation
/* Comment on multiline content */
SQL -- Comment
There is no annotator In the start and end tags of the server control, but the server can ignore all attributes that it cannot recognize. Therefore, we can insert comments by using unspecified attributes. The following is an example of ASP. NET annotation:
- & Lt; asp: TextBox
-
- Id ="TxtLastName"
-
- Size ="40"
-
- Comment ="This is my comment"
-
- Runat ="Server"/& Gt;
It is very easy to annotate the source code in Visual Studio. NET. The lines to be annotated are displayed in High Brightness. Press Ctrl + K + C to add comments. To delete a comment, you only need to display the commented code with High Brightness and press Ctrl + K + U.
In the ASP. NET project, you can also enter the XML comment section at the beginning of each line. In the annotations section, we can use the following XML tag to organize Annotations:
- <summary></summary>
-
- <remarks></remarks >
-
- <param></param>
-
- <returns></returns>
-
- <newpara></newpara>
To view the formatted reports of these XML annotations in Visual Studio. NET, select the "Tools" menu item and then select the "Create annotation Web page" menu item.
ASP. NET annotation skills will be introduced here, I hope to help you develop your programming habits.
- ASP. NET naming settings
- ASP. NET control usage tips
- Analysis on ASP. NET technique to improve application performance
- Use of StringBuilder class in ASP. NET skills
- Analysis of data collection procedures using ASP. NET Techniques