NET Framework 2.0's base class libraries; consequently, they will only work in ASP. Alternatively, you may adapt the code presented here to work in ASP. A validation control's primary responsibility is to determine whether or not its assigned control's value is valid.What constitutes validity depends on the validation control - a Required Field Validator, for example, checks to ensure that its control's current value doesn't equal the specified property indicates the least number of Check Box List items that must be selected for validity.To provide such validation, we have three choices: In this article we'll implement the third option, creating two custom server controls, Check Box Validator and Check Box List Validator. The server controls provided in this article were designed using Visual Studio 2005 and the . NET 1.x, check out Creating a Validation Control for Check Box Lists.The download at the end of this article includes both the entire source code and a compiled assembly that you can drop into your ASP. NET Framework 2.0's base class libraries; consequently, they will only work in ASP. Alternatively, you may adapt the code presented here to work in ASP. The server controls examined in this article were designed using Visual Studio 2005 and the . NET 1.x, check out Creating a Validation Control for Check Box Lists. NET provides a variety of validation Web controls that can be used to validate a user's form field inputs. NET 2.0 for the validation control changes from ASP. NET version 2.0.) Unfortunately, the validation Web controls do not work with the Check Box or Check Box List Web controls. for general information on the validation Web controls and Dissecting Validation Controls in ASP.By default, clicking a Check Box control does not cause page validation.To perform page validation when the Check Box control is clicked, set the property to specify the name of the validation group for which the Check Box control causes validation.
Per the documentation, for any validator control the "standard controls that can be validated are Text Box, List Box, Drop Down List, Radio Button List, System. NET Web pages that use the control (see the following example for the syntax). NET Web page shows a simple example of using this custom control to validate a Check Box List - a task that was impossible using the built-in Required Field Validator. ] Conclusion In this tip we looked at how to create a very simple required field validator validation Web control that could handle Check Box Lists.
NET server control that can be used in place of a Required Field Validator for Check Box List Web controls. NET is that you can simply create a new custom Web control that includes the desired functionality. NET, create a file with a property is not set or is set to a nonexistent server control, the property will return false.
In this tip we'll examine how to build a custom ASP.
This is the methods that performs the server side validation in case Java Script is not enabled on the client, or not supported.
In this method I just loop through all the items of the Check Box List and if I find one that is selected then I return true.