Friends programming friends often like to collect some "wonderful" programming skills. However, the accumulation of skills often does not improve the quality of the program, but guide some programming people to pursue and new, forget the cultivation of basic programming, not conducive to the team Cooperation, possibly, this is also a reason why China does not lack smart, but lacks a clever development team. In the development of ASP.NET, there are a lot of skills, but some basic programming habits we must develop, which can not only fundamentally improve the quality and development efficiency, but also facilitate the reading and team development of procedures. . If you write, you can understand or only a few people can understand, even if the program skills are skillful, the upgrade and maintenance of the program is a fatal issue.
I. The most basic requirements of the problem of the handler (outside) is the most basic requirements of the program error. In ASP.NET, the wrong handling has the same mechanism as other programming languages, you can use Try ... catch ... finaly or other means, This is more advanced compared to the ASP. Moreover, using these error handling methods, it can greatly improve the program's readability and program debugging speed. In the case of these advantages, we should pay more attention to this. About the wrong process, we can refer to this article (English): http://www.123aspx.com/redir.aspx?res=28336
Second, the processing web design of the string, the processing of strings is almost the most common. After using ASP.NET, the processing of strings is faster than ASP, and in ASP.NET, it is specifically adding a string handling class StringBulider. Use this class to complete some common string operations, and the main, Use StringBuilder to greatly improve string processing speed. In ASP.NET, the most common is the use, "" connected to two strings: Dim myOutputString As String = "My name is" Dim myInputString As String = "Alex" myOutputString = myOutputString & myInputString Response.Write (myoutputString) Now let's take a look at the use of StringBuilder. When using StringBuilder, we can do some basic operations for strings, such as Append, Replace, Insert, Remove, etc., now let's see specific examples. (1) Append's Append and other languages in StringBuilder, is the last addition of other characters in the string. DIM SB AS STRINGBUILDER = new stringbuilder () sb.append ("