Microsoft Developer
Form validation exercise
Harder than average exercise

This Microsoft Developer FORM VALIDATION exercise is provided to allow potential course delegates to assess their suitability for the Wise Owl ASP.NET 2.0 USING C# course only, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.

Exercise: Drink order form - server side validation code

A full answer to this exercise is provided as part of the training course!

1) Create a form for ordering a drink (or use the one that you created for the previous exercise):
Exercise screen-shot 1618 A simple form with one text input and one integer one
2) Add code to the Place Order button to:
  • Check that a drink is filled in (and report an error otherwise)
  • Do the same for the number of ice cubes
  • Check that the number of ice cubes is indeed an integer
  • Check that this integer lies between 0 and 10
3) Your final form should look similar to this, for example, if you enter too many ice cubes:
Exercise screen-shot 1619 A sample error message
4) Save and close down any files that you may have open.

Thank you for showing an interest in this ASP.NET 2.0 using C# training course! As mentioned above, full answers to this and other exercises are provided on the course. On all Wise Owl scheduled courses delegates can take away these model answers (together with their own efforts!) on a free USB stick.

All content copyright Wise Owl Business Solutions Ltd.  All rights reserved..