ASP. NET Learning (1) Web Form

Source: Internet
Author: User

1. First create a new ASP. NET Web application, select the empty template, the default set up directory is as follows

2. Create a new Web Form file that will generate three files, the Web Form file itself aspx, the code-behind class file Cs, and the designer file

3. Render the page with standard code snippets

4. Use the content snippet to render the page, which moves the relevant logic into the code-behind class file

5. Using data-bound code snippets, this time we'll use the control repeater to iterate through the array

The effect is as follows:

If you want to use compiled data-bound code snippets, you should

6. Using the attribute code fragment, the method adds elements to the Web. config file that are introduced with the literal control in the website form. 7. Programmable HTML elements

By adding the runat= "Server" property to the elements of a Web Forms file, the label becomes a programmable HTML element that can be manipulated by hiding code

Using the master page *************

Use a master page to create the same appearance for 2 or more Web Forms

1. Create a master page with the initial content as follows

As you can see, the master page generates two ContentPlaceHolder controls by default, one for inserting content in the head section and one for populating the form elements in the body. A Web form that inherits the master page also automatically generates two ContentPlaceHolder. Their contentplaceholderid is consistent with the ID of the master page

The ContentPlaceHolder content that we write in the Inheritance class form will replace the content in the corresponding location of the master page. and make the presentation.

ASP. NET Learning (1) Web Form

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.