Current location - Recipe Complete Network - Food recipes - Introduction to ASP.NET Tutorial 10.4 Creating a background code file [1]
Introduction to ASP.NET Tutorial 10.4 Creating a background code file [1]
? The following try exercise creates a fairly simple background code file that interacts with a sample page that contains a TextBox button and a Label control. When using a single file, you will see how to operate all these controls in the same way.

? () Open VWD and create a new website Test Code Behind (c: \ begaspnet \ chapters} begin \ chapter) in the chapter directory.

? () Enter Solution Explorer and click the plus sign (+) next to Default aspx to expand the directory tree to display the file Default aspx vb.

? Again, the default aspx is the only file automatically created by the background code file. If you create another web form, you must ensure that Location Code is selected in the Separate File option, which is not selected by default.

? () First return to the default aspx file and add two Label controls, a TextBox control and a Button control.

? Adjust the source HTML code as follows

?

& lt ASP: label id = label runat = servertext = what's the answer?

? The meaning of life, the universe and everything? :& gt& lt/ASP:Label & gt;

? & ltbr/>;

? & ltASP:TextBox ID = TextBox runat = server & gt; & lt/ASP:TextBox & gt;

? & ltbr/>;

? & ltASP:Button ID = Button runat = server Text = Submit/& gt;

? & ltbr/>;

? & ltASP:Label ID = Label runat = server Text = Label & gt; & lt/ASP:Label & gt; ASP NET introductory tutorial full version

Lishi Xinzhi/Article/program/net/20 13 1 1/ 14638