Developer on Alibaba Coud: Build your first app with APIs, SDKs, and tutorials on the Alibaba Cloud. Read more ＞
1. Introduction to Code Behind
Code Behind is the so-called Code separation. Since Microsoft launched ASP. NET, Code Behind is a hot topic. In general ASP. in the. NET file, Code Behind mainly uses two files to create an ASP.. NET page, one of which is a design file, generally. aspx or. ascx is used as the extension, and the other is the program code file, which generally uses. vb or. cs is used as the extension, and its programming language is VB. net or C #.
II. Advantages of Code Behind
Anyone who has compiled an ASP program knows that the ASP program combines interface design with program design. Therefore, when the program designer needs to modify the layout of the application interface, it usually needs to change a lot of code irrelevant to the interface. For a small program, the workload is not great, for programs with a large amount of code, it is a heavy workload. Code Behind separates the interface design Code and program design Code from each other in different files. For Code reuse, program debugging and maintenance are revolutionary. Another point is that when you publish your website, you can use this technology to effectively protect your code. This improves program security. The emergence of Code Behind technology is somewhat like that of VB or Delphi in the past. This is why he became a hot topic when he appeared. The following uses a complete example to describe the features of Code Behind technology.
III. Introduction to the example
The running environment of this example is Windows 2000 Prefessional and. Net FrameWork SDK Beat 2. The programming language is c #, and its main function is to send emails. The program is divided into two parts. The interface code for sending an email is saved in the mail. aspx file, and the sending program is saved in the send. cs file.
IV. Implementation steps
1) create an HTML page
You can use Microsoft's FontPage to design the entire layout of your page. Design all your options on this page.
Name the HTML file send.htm. The code is as follows:
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
<Meta name = "GENERATOR" content = "Microsoft FrontPage 4.0">
<Meta name = "ProgId" content = "FrontPage. Editor. Document">
<Title> New Page 1 </title>
<H3> Welcome to the Code Behind design interface <Form>
<Table border = "1" width = "100%">
This article is an English version of an article which is originally in the Chinese language on aliyun.com and is provided for information purposes only. This website makes no representation or warranty of any kind, either expressed or implied, as to the accuracy, completeness ownership or
reliability of the article or any translations thereof. If you have any concerns or complaints relating to the article, please send an email, providing a detailed description of the concern or
complaint, to email@example.com. A staff member will contact you within 5 working days. Once verified, infringing content will be removed immediately.
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:
and provide relevant evidence. A staff member will contact you within 5 working days.