ASP.NET Guestbook - Setting Up the Drop Down Box (Page 3 of 8 )
Populate the drop down box as shown in the below figure. To open the ListItem CollectionEditor, select the Item property in the property sheet. ListItem editor will appear as show below.
Use Add item to add Text and Value. Make sure you always enter only integers in the Value field and user-friendly remarks in the Text Field.

All the aforementioned controls are available in the studio toolbox.
Validators
The good news about ASP.NET is that there is no need for a developer to code validators, instead of that, Microsoft has introduced a set of validators for those mundane tasks. I’ve included ASP: RequiredFieldValidator in this web app. The main function of this validator is to check whether there are inputs in the bounded controls. In our case , all the textboxes. Drag and Drop four Required field validators and bind through the controls as mentioned below.
Validator | Name of the validator | ControlToValidate |
ASP:RequiredFieldValidator | reqName | txtName |
ASP:RequiredFieldValidator | reqEmail | txtEmail |
RequiredFieldValidator | reqComments | txtComments |
ASP:ValidationSummary | validPage | -- |
Enter the error messages in their respective property pages.
Next: Connecting to the Database >>
More ASP.NET Code Articles
More By R. Abhiram Vikrant