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