Code Behind Technology in ASP.NET. Introduction to Code Behind is the so-called code separation. Since Microsoft has launched ASP.NET, Code Behind is a hot topic. In a general ASP.NET file, Code Behind is mainly used to create an ASP.NET page in two files, one is a design file, which is generally made as an extension in .aspx or .ascx, and the other is the program code Files, generally in .vb or .cs as an extension, the programming language is mainly VB.NET or C #. two. Code Behind Benefits Users who have used ASP compiled programs that the ASP program is mixed with interface design and program design. Therefore, when the program designer wants to modify the application interface layout, it is often necessary to change the code that is not related to the interface. For a small program, the workload is not very large. If the program is large for the code, it is a workload. Not small. Code Behind separates the interface design code and program design code, separated by different files, and reuses the code, the debugging and maintenance of the program is revolutionary. Another point is that when you post your website, you can use this technology to effectively protect your code. This is an improvement for the security of the program. The appearance of Code Behind technology is a bit like VB or Delphi appears. This is why he has become a hot topic. Below we use a complete example to specifically explain the characteristics of Code Behind technology. three. Example Introduction This example is the operating environment of Windows 2000 Preferenceional and .NET Framework SDK BEAT 2. The programming language is C #, and its main function is to send an email. The program is divided into two parts, saving the interface code of the sending email in the mail.aspx file, and the transmitted program is saved in Send.cs file.
four. Specific implementation Step 1). New HTML page You can use Microsoft's FontPage to design your page's entire layout. Design your option to this page. Name this HTML file Send.htm.
The specific code is as follows: