Hour 11. Collecting Input Using Drop-down Lists, Radio Buttons, and Check Boxes


In this hour, we will cover

  • Ideal times for using Web controls other than the TextBox Web control

  • Adding DropDownList Web controls to an ASP.NET web page

  • Programmatically accessing a selected value and text from a DropDownList Web control

  • Using the RadioButton Web control

  • Grouping related RadioButton Web controls

  • Using the CheckBox Web control

  • Programmatically determining whether a particular CheckBox Web control is checked

In the preceding hour we saw how to collect user information through the TextBox Web control. Often, though, the text box is not the most suitable means for collecting a particular piece of input. For example, imagine that you wanted to create a web page where the user answered a bunch of yes/no questions. Would it make sense to use a TextBox Web control for these yes/no questions, making the user type in the words "Yes" or "No"?

Fortunately, there are alternative Web controls for collecting user input, such as the DropDownList Web control, the RadioButton Web control, and the CheckBox Web control. We will examine these three Web controls in this hour.




Sams Teach Yourself ASP. NET 2.0 in 24 Hours, Complete Starter Kit
Sams Teach Yourself ASP.NET 2.0 in 24 Hours, Complete Starter Kit
ISBN: 0672327384
EAN: 2147483647
Year: 2004
Pages: 233

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net