Home > Articles

  • Print
  • + Share This
This chapter is from the book

Workshop

This workshop will help reinforce the concepts covered in today's lesson. The answers can be found in Appendix A.

Quiz

  1. When should you use a for loop? A while loop?

  2. What is the output of the following code snippet?

  3. Dim I as integer = 5
    Do
      Response.Write(I & " ")
      I = I + 2
    Loop Until I > 10
  4. What is the output of the following code snippet?

  5. Dim I as integer = 5
    Do
      I = I + 2
      Response.Write(I & " ")
    Loop Until I > 10
  6. What are the standard event handler parameters for ASP.NET pages?

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 enumeration—convert 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.

  • + Share This
  • 🔖 Save To Your Account