Respect the author. Keep the words www.it55.com.
In the previous section, we created the first Asp.net 2.0 application. After the application is created, vs automatically generates a default. aspx page.
Next we will use this default. ASPX page to start our Asp.net development journey.
Switch default. asp to the design window (click "design" at the bottom of the page "),
Drag the textbox in the toolbox to the page,
Right-click the "attribute" menu and change its ID to input,
Similarly, we drag a button and name its ID btok, and change its text value to "OK ",
Double-click "OK". vs opens the default. aspx background program file default. aspx. CS for us,
We can see that there is a page_load function, which handles page loading events; the other is the btok_click event, which is the event processing function triggered by the click event of our "OK" button.
In this function, we can write the statements we need to meet our program requirements. For example, we can write response. write (input. text.
Now we have finished writing our first program. Now we use CTR + Shift + B to compile the program and run it with the F5 key to view the effect. (Alternatively, you can run the command directly through "start execution (not debugging)" in the "debug" menu)
If there is no accident, we will see the following page:
Enter "www.itgao.com online tutorial" in the text box, and click "OK" to see what the effect will be:
The page outputs the input content directly to the page :)
After the program is ready, how can it be released? This is the Asp.net Application Deployment function. There are two ways to deploy an application:
1. Copy a Website: copy the program to the target server through the copy website function in the "website" menu in Vs, for example:
This method is a simple file copy process.
2. website publishing: Compile the program using the "Publish Website" function in the "generate" menu in Vs and copy the compiled files to the target server, for example:
The process of creating, compiling, compiling, and deploying the first ASP. net2.0 application is complete here.
Which of the following statements, functions, and data types are commonly used in the C # language in Asp.net? What are the rules to follow? We will learn this knowledge with you in the following chapters.