-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCheckBoxListValidator.vb
More file actions
60 lines (44 loc) · 1.5 KB
/
CheckBoxListValidator.vb
File metadata and controls
60 lines (44 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Imports Microsoft.VisualBasic
Imports System.Web.UI.WebControls
Namespace ODS.DNN.Modules.Form
Public Class CheckBoxListValidator
Inherits BaseValidator
Protected Overrides Function EvaluateIsValid() As Boolean
Dim isValid As Boolean = False
Dim cb As CheckBoxList = FindControl(Me.ControlToValidate)
For Each li As ListItem In cb.Items
If li.Selected = True Then
isValid = True
End If
Next
Return isValid
End Function
Protected Overrides Function ControlPropertiesValid() As Boolean
If Me.ControlToValidate <> String.Empty Then
Return True
Else
Return False
End If
End Function
End Class
''' <summary>
''' '01.00.03: Checkbox validator
''' </summary>
''' <remarks></remarks>
Public Class CheckBoxValidator
Inherits BaseValidator
Protected Overrides Function EvaluateIsValid() As Boolean
Dim isValid As Boolean = False
Dim cb As CheckBox = FindControl(Me.ControlToValidate)
isValid = cb.Checked
Return isValid
End Function
Protected Overrides Function ControlPropertiesValid() As Boolean
If Me.ControlToValidate <> String.Empty Then
Return True
Else
Return False
End If
End Function
End Class
End Namespace