Code Behind technology in ASP. NET

Source: Internet
Author: User
Tags microsoft frontpage
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:
<Html>
<Head>
<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>
</Head>
<Body>
<H3> Welcome to the Code Behind design interface <Form>
<Table border = "1" width = "100%">
<Tr>
Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.