Small test, make a simple asp.net program

Source: Internet
Author: User
Asp.net| program by learning the first few sections of the concept of headache and hard installation configuration work, we already have the development of asp.net procedures of the initial knowledge and operating platform, then, let us begin to enter the ASP.net world, feel asp.net wonderful bar.

We use the most rudimentary development tool-Notepad, to suggest the first asp.net page, add the following code in Notepad:

<%@ Page language= "VB"%>
<title>my-asp.net pages!</title>
<body>
</body>
<script language= "VB" runat= "Server" >
Private Sub Page_Load (sender as System.Object, ByVal e as System.EventArgs)
Response.Write ("Hello asp.net! This is my asp.net pages! ")
End Sub
</script>

In the above code, the <%@ Page language= "VB"%> tells the Web server that the program is written in the Visual Basic.NET language, and you can write it using the C # language, of course. Where the logical snippet is all in <Script></Script>, runat= "Server" indicates that the code is to be compiled on the server side, and that the firing event of the code execution is Page_Load, that is, when the page is loaded into memory, The result of running the program is to display a sentence on the page: Hello asp.net! This is my asp.net pages!. For VB 6.0 programmer, this piece of code is again familiar with. In future chapters, this book will detail the ASP.net programming rules and the Visual Basic.NET language usage rules.
Save the code as a hello.aspx file and store it in the root directory of IIS (the system defaults to C:\Inetpub\wwwroot). Then enter in the IE Address: http://localhost/Hello.aspx, get the preview effect as shown in Figure 1.22.

Figure 1.22 hello.aspx Run Results



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.