C radiobutton validating
Your solution works fine for your purposes though: loop through all of the elements in the page and find a Radio Button List...validate.For more information check out how to use Java Script in ASP.In the Validating event-handling method, you can validate user input in several ways.For example, if you have a text box that must contain a postal code, you can perform the validation in the following ways: The Validating event is supplied an object of type Cancel Event Args.The Format event on a data binding can be used to reformat incoming data to comply with the mask, and the Parse event can be used to reformat outgoing data to comply with the specifications of the data field. If you want full programmatic control over validation, or need to perform complex validation checks, you should use the validation events built into most Windows Forms controls.Each control that accepts free-form user input has a Validating event that will occur whenever the control requires data validation.When users enter data into your application, you may want to verify that the data is valid before your application uses it.You may require that certain text fields not be zero-length, that a field be formatted as a telephone number or other type of well-formed data, or that a string not contain any unsafe characters that could be used to compromise the security of a database.
The following code creates a toggle group and three radio buttons and then adds each radio button to the toggle group, and specifies which button should be selected. The Change Listener object checks a selected item in the group.
For a code example that validates an email address in a Text Box, see Validating.
Validation is very useful when you have bound your controls to a data source, such as a database table.
We handle the radio button selected event through the Toggle Group. The selected radio button is returned from the get Selected Toggle method.
Then we get the user data by calling the get User Data method.