asp.net first Experience

Source: Internet
Author: User
ASP.net finally learned the asp.net. There are two years experience in ASP development I always thought that ASP. NET will not be difficult. I chose vb.net to develop ASP.net, because I have learned VB, and the development of ASP is also the use of VBS. It is because of the development experience of VB and VBS, I am full of confidence in ASP.net's study.
Configure the operating environment of ASP.net: A new blank aspx page with DW, press F12, can display normally, this shows that my asp.net running environment has been configured successfully! So, I presume to enter the following code:
<script LANGUAGE=VB runat=server>
Response.Write "My first asp.net program."
</script>
Press F12 with confidence, but the result is "compile error." Looking at the wrong explanation, I could not touch my head. Had to open the tutorial, finally found the answer, so I changed the program to:
<script LANGUAGE=VB runat=server>
Sub Page_Load ()
Response.Write "My first asp.net program."
End Sub
</script>
Once again, the result is F12. The compile error: The method argument must be enclosed in parentheses. "That's it, ASP. NET's syntax is so strict. In the ASP, Response.Write "My first asp.net program" is completely legitimate, absolutely normal operation.
Replace the procedure with the following:
<script LANGUAGE=VB runat=server>
Sub Page_Load ()
Response.Write ("My first asp.net program")
End Sub
</script>
Finally, OK! At this time I do not have the joy of success, but I feel sad ...
My favorite is to use for ... NEXT, so I changed the program to:
<script LANGUAGE=VB runat=server>
Sub Page_Load ()
For I=1 to 100
Total=total+i
Next
Response.Write (Total)
End Sub
</script>
Looking forward to output 5050, the result is error----"I" undefined. Cold, the original is no longer like the VBS in the ASP, do not need to declare the variable explicitly, but to display the declaration variable. Had to change the procedure to read:
<script LANGUAGE=VB runat=server>
Sub Page_Load ()
Dim i,total As Integer
For I=1 to 100
Total=total+i
Next
Response.Write (Total)
End Sub
</script>
The lovely 5050 finally came out ~ ~ ~ ~ ~

The purpose of my writing this post is to tell my friends who are ready to learn asp.net, and pay attention to the standardization of the Code! In particular, C # friends, but also pay attention to a case sensitive problem. At the same time, XML has a very strict syntax rules, such as, in HTML <br> is legal, but in XML, must add a terminator, that is, <br/>.



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.