Workshop
This workshop will help reinforce the concepts covered in today's lesson. The answers can be found in Appendix A.
Quiz
-
When should you use a for loop? A while loop?
-
What is the output of the following code snippet?
-
What is the output of the following code snippet?
-
What are the standard event handler parameters for ASP.NET pages?
Dim I as integer = 5 Do Response.Write(I & " ") I = I + 2 Loop Until I > 10
Dim I as integer = 5 Do I = I + 2 Response.Write(I & " ") Loop Until I > 10
Exercises
Create an ASP.NET page with a class that represents you, with properties that describe your hair color, eye color, and birth date. Use the DayOfWeek property of the DateTime data type to determine the day of the week of your birthday. The DayOfWeek property returns an value from the DayOfWeek enumerationconvert this into a string representing the day. Call this method whenever a user clicks the Submit button, and print the output to the browser.
Hint: You'll need to use the new keyword with the DateTime data type. Pass three parameters into the new DateTime data type: the year, month, and day of month, in that order. For example:
dim MyDate as new DateTime(2002,1,1) 'January 1, 2002
For more information on .NET, visit our .NET Reference Guide or sign up for our .NET Newsletter.